Skip to content

Commit

Permalink
Merge code changes from upstream 8.13.27
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddrysdale committed Dec 20, 2023
1 parent 070f7c6 commit ed4c859
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/phonenumbers/phonenumberutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,14 +1091,13 @@ def format_number(numobj, num_format):
Returns the formatted phone number.
"""
if numobj.national_number == 0 and numobj.raw_input is not None:
if numobj.national_number == 0:
# Unparseable numbers that kept their raw input just use that. This
# is the only case where a number can be formatted as E164 without a
# leading '+' symbol (but the original number wasn't parseable
# anyway).
# TODO: Consider removing the 'if' above so that unparseable strings
# without raw input format to the empty string instead of "+00".
if len(numobj.raw_input) > 0:
raw_input = numobj.raw_input or ""
if len(raw_input) > 0 or numobj.country_code is None:
return numobj.raw_input
country_calling_code = numobj.country_code
nsn = national_significant_number(numobj)
Expand Down

0 comments on commit ed4c859

Please sign in to comment.