Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
piphone-sip
Commits
8f5397c0
Commit
8f5397c0
authored
Apr 19, 2017
by
okhin
Browse files
If re.groups does not match, they're of type None
parent
6af6747b
Changes
1
Hide whitespace changes
Inline
Side-by-side
piphone.py
View file @
8f5397c0
...
...
@@ -157,7 +157,7 @@ def sanitize_phonenumber(number):
if
bl_re
!=
None
:
# We have blacklisted patterns, need to chck for them
groups
=
re
.
match
(
bl_re
,
number
)
if
len
(
groups
)
>=
1
:
if
groups
is
not
None
:
# We matched, so we're blacklisted
raise
ValueException
(
'{} is blacklisted. Reason: {}'
,
(
number
,
groups
.
groupdict
().
keys
[
0
],))
return
number
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment