summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Drysdale <dmd@lurklurk.org>2013-08-10 19:17:28 +0100
committerDavid Drysdale <dmd@lurklurk.org>2013-08-10 19:17:28 +0100
commit0f8523cff7b28f21402cc98f3a9b7b02672b4977 (patch)
tree28a6e57105637a80a12b5ae57781a91e4caacb72
parent418bed53f0a78399572d09de0b239b63aa083ee2 (diff)
Fix some Py3K failures from mismerges
-rw-r--r--python/phonenumbers/phonenumbermatcher.py2
-rw-r--r--python/phonenumbers/shortnumberutil.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/python/phonenumbers/phonenumbermatcher.py b/python/phonenumbers/phonenumbermatcher.py
index a5852c10..73a1bf0e 100644
--- a/python/phonenumbers/phonenumbermatcher.py
+++ b/python/phonenumbers/phonenumbermatcher.py
@@ -355,7 +355,7 @@ def _contains_more_than_one_slash_in_national_number(numobj, candidate):
numobj.country_code_source == CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN)
if (candidate_has_country_code and
normalize_digits_only(candidate[:first_slash_in_body_index]) ==
- unicode(numobj.country_code)):
+ unicod(numobj.country_code)):
# Any more slashes and this is illegal.
return (candidate[(second_slash_in_body_index + 1):].find(U_SLASH) != -1)
return True
diff --git a/python/phonenumbers/shortnumberutil.py b/python/phonenumbers/shortnumberutil.py
index bc440aa7..ea7654c4 100644
--- a/python/phonenumbers/shortnumberutil.py
+++ b/python/phonenumbers/shortnumberutil.py
@@ -20,6 +20,7 @@ Note most commercial short numbers are not handled here, but by phonenumberutil.
import re
from .re_util import fullmatch
+from .util import U_EMPTY_STRING
from .phonemetadata import PhoneMetadata
from .phonenumberutil import _extract_possible_number, _PLUS_CHARS_PATTERN
from .phonenumberutil import normalize_digits_only
@@ -36,11 +37,11 @@ class ShortNumberCost(object):
def _example_short_number(region_code):
metadata = PhoneMetadata.short_metadata_for_region(region_code)
if metadata is None:
- return u""
+ return U_EMPTY_STRING
desc = metadata.short_code
if desc.example_number is not None:
return desc.example_number
- return u""
+ return U_EMPTY_STRING
def _example_short_number_for_cost(region_code, cost):
@@ -56,11 +57,11 @@ def _example_short_number_for_cost(region_code, cost):
"""
metadata = PhoneMetadata.short_metadata_for_region(region_code)
if metadata is None:
- return u""
+ return U_EMPTY_STRING
desc = _short_number_desc_by_cost(metadata, cost)
if desc is not None and desc.example_number is not None:
return desc.example_number
- return u""
+ return U_EMPTY_STRING
def _short_number_desc_by_cost(metadata, cost):