Skip to content

Commit 9402df4

Browse files
committed
Merge code changes from upstream r574
1 parent 0765252 commit 9402df4

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

python/phonenumbers/phonenumberutil.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -953,14 +953,21 @@ def format_number_for_mobile_dialing(numobj, region_calling_from, with_formattin
953953
# the carriers won't connect the call. Because of that, we return
954954
# an empty string here.
955955
formatted_number = ""
956+
elif region_code == "HU":
957+
# The national format for HU numbers doesn't contain the national
958+
# prefix, because that is how numbers are normally written
959+
# down. However, the national prefix is obligatory when dialing
960+
# from a mobile phone. As a result, we add it back here.
961+
formatted_number = (ndd_prefix_for_region(region_code, True) + # strip non-digits
962+
u" " + format_number(numobj_no_ext, PhoneNumberFormat.NATIONAL))
956963
else:
957-
# For NANPA countries, non-geographical countries, and Mexican
958-
# fixed line and mobile numbers, we output international format
959-
# for numbers that can be dialed internationally as that always
960-
# works.
964+
# For NANPA countries, non-geographical countries, Mexican and
965+
# Chilean fixed line and mobile numbers, we output international
966+
# format for numbers that can be dialed internationally as that
967+
# always works.
961968
if ((country_calling_code == _NANPA_COUNTRY_CODE or
962969
region_code == REGION_CODE_FOR_NON_GEO_ENTITY or
963-
(region_code == "MX" and is_fixed_line_or_mobile)) and
970+
((region_code == "MX" or region_code == "CL") and is_fixed_line_or_mobile)) and
964971
_can_be_internationally_dialled(numobj_no_ext)):
965972
# MX fixed line and mobile numbers should always be formatted
966973
# in international format, even when dialed within MX. For

0 commit comments

Comments
 (0)