Skip to content

Commit 2ce1ae3

Browse files
committed
Merge pull request #1 from rootnroll/master
Fix python3 support
2 parents e2d3961 + 2bfd26e commit 2ce1ae3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

gdapi.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def delete(self, *args):
397397
return self._delete(i.links.self)
398398

399399
def action(self, obj, action_name, *args, **kw):
400-
url = obj.actions[action_name]
400+
url = getattr(obj.actions, action_name)
401401
return self._post(url, data=self._to_dict(*args, **kw))
402402

403403
def _is_list(self, obj):
@@ -479,8 +479,7 @@ def _bind_methods(self, schema):
479479
# a better way to do this
480480
cb = lambda type_name=type_name, method=m: \
481481
lambda *args, **kw: method(type_name, *args, **kw)
482-
if hasattr(type, type_collection) and \
483-
test_method in typ[type_collection]:
482+
if test_method in getattr(typ, type_collection, []):
484483
setattr(self, '_'.join([method_name, name_variant]),
485484
cb())
486485

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
argcomplete==0.7.0
2-
requests==2.2.1
1+
argcomplete
2+
requests
33
six

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='gdapi-python',
9-
version='0.5.1',
9+
version='0.5.2',
1010
py_modules=['gdapi'],
1111
url='https://github.com/godaddy/gdapi-python',
1212
license='MIT Style',

0 commit comments

Comments
 (0)