Skip to content

Commit

Permalink
Prefer SUPPORTED_REGIONS over _AVAILABLE_REGION_CODES
Browse files Browse the repository at this point in the history
SUPPORTED_REGIONS is public.
  • Loading branch information
francoisfreitag committed Sep 7, 2022
1 parent 9d568cc commit 0cd27e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phonenumber_field/phonenumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ def to_python(value, region=None):
def validate_region(region):
if (
region is not None
and region not in phonenumbers.shortdata._AVAILABLE_REGION_CODES
and region not in phonenumbers.phonenumberutil.SUPPORTED_REGIONS
):
raise ValueError(
"“%s” is not a valid region code. Choices are %r"
% (region, phonenumbers.shortdata._AVAILABLE_REGION_CODES)
% (region, phonenumbers.phonenumberutil.SUPPORTED_REGIONS)
)

0 comments on commit 0cd27e2

Please sign in to comment.