Skip to content

Commit 34ccd4b

Browse files
committed
Fix Python 2 compatibility
1 parent 4320f5b commit 34ccd4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/variants/_variants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def myfunc(url):
2727
do_something(r.text)
2828
"""
2929

30-
class VariantFunction:
30+
class VariantFunction(object):
3131
__doc__ = f.__doc__
3232

3333
def __init__(self):
@@ -49,10 +49,10 @@ def decorator(vfunc):
4949

5050
return decorator
5151

52-
def __get__(self, instance, owner):
52+
def __get__(self, obj, objtype=None):
5353
# This is necessary to bind instance methods
54-
if instance is not None:
55-
return VariantMethod(self, instance)
54+
if obj is not None:
55+
return VariantMethod(self, obj)
5656

5757
return self
5858

0 commit comments

Comments
 (0)