Skip to content

Commit

Permalink
Fixed async funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Aug 31, 2018
1 parent 3d41a50 commit 704235f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphene/utils/thenables.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from promise import Promise, is_thenable
except ImportError:

class Promise(object):
pass

def is_thenable(obj):
return False

Expand All @@ -28,7 +31,7 @@ def maybe_thenable(obj, on_resolve):
returning the same type of object inputed.
If the object is not thenable, it should return on_resolve(obj)
"""
if isawaitable(obj):
if isawaitable(obj) and not isinstance(obj, Promise):
return await_and_execute(obj, on_resolve)

if is_thenable(obj):
Expand Down

0 comments on commit 704235f

Please sign in to comment.