Skip to content

Commit

Permalink
Allow host:port strings to be specified as Unicode string
Browse files Browse the repository at this point in the history
  • Loading branch information
svisser committed Apr 26, 2015
1 parent 5917c9b commit 88613b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gearman/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
PY3 = sys.version_info[0] >= 3

if PY3:
basestring_type = str
bytes_type = bytes
else:
basestring_type = basestring
bytes_type = str

# Required for python2.4 backward compatibilty
Expand Down
2 changes: 1 addition & 1 deletion gearman/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, host_list=None):
host_list = host_list or []
for element in host_list:
# old style host:port pair
if isinstance(element, str):
if isinstance(element, compat.basestring_type):
self.add_connection(element)
elif isinstance(element, dict):
if not all (k in element for k in ('host', 'port', 'keyfile', 'certfile', 'ca_certs')):
Expand Down

0 comments on commit 88613b8

Please sign in to comment.