Skip to content

Commit a6e6136

Browse files
committed
Merge code changes from upstream v8.9.15
1 parent da71c5f commit a6e6136

2 files changed

Lines changed: 1 addition & 23 deletions

File tree

python/phonenumbers/phonenumbermatcher.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -662,28 +662,6 @@ def _parse_and_verify(self, candidate, offset):
662662
return None
663663

664664
numobj = parse(candidate, self.preferred_region, keep_raw_input=True)
665-
# Check Israel * numbers: these are a special case in that they
666-
# are four-digit numbers that our library supports, but they can
667-
# only be dialled with a leading *. Since we don't actually store
668-
# or detect the * in our phone number library, this means in
669-
# practice we detect most four digit numbers as being valid for
670-
# Israel. We are considering moving these numbers to
671-
# ShortNumberInfo instead, in which case this problem would go
672-
# away, but in the meantime we want to restrict the false matches
673-
# so we only allow these numbers if they are preceded by a
674-
# star. We enforce this for all leniency levels even though these
675-
# numbers are technically accepted by isPossibleNumber and
676-
# isValidNumber since we consider it to be a deficiency in those
677-
# methods that they accept these numbers without the *.
678-
# TODO: Remove this or make it significantly less hacky once we've
679-
# decided how to handle these short codes going forward in
680-
# ShortNumberInfo. We could use the formatting rules for instance,
681-
# but that would be slower.
682-
if (region_code_for_country_code(numobj.country_code) == "IL" and
683-
len(national_significant_number(numobj)) == 4 and
684-
(offset == 0 or (offset > 0 and self.text[offset - 1] != U_STAR))): # pragma no cover
685-
# No match.
686-
return None
687665
if _verify(self.leniency, numobj, candidate):
688666
# We used parse(keep_raw_input=True) to create this number,
689667
# but for now we don't return the extra values parsed.

python/tests/shortnumberinfotest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def testGetExpectedCostForSharedCountryCallingCode(self):
173173
shortnumberinfo.expected_cost(ambiguousTollFreeNumber))
174174

175175
def testGetExampleShortNumber(self):
176-
self.assertEqual("8711", shortnumberinfo._example_short_number("AM"))
176+
self.assertEqual("110", shortnumberinfo._example_short_number("AD"))
177177
self.assertEqual("1010", shortnumberinfo._example_short_number("FR"))
178178
self.assertEqual("", shortnumberinfo._example_short_number("001"))
179179
self.assertEqual("", shortnumberinfo._example_short_number(None))

0 commit comments

Comments
 (0)