Skip to content

Commit 53b3d0a

Browse files
committed
PI-414 : Fixed bug with nested function calls, moved to future versioning scheme
1 parent 3dbf3e4 commit 53b3d0a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stackdio/client/http.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,19 @@ def wrapper(obj, *args, **kwargs):
6666
path=path.format(**future_locals))
6767

6868
g = func.__globals__
69-
oldvalue = g.get('endpoint')
69+
sentinal = object()
70+
oldvalue = g.get('endpoint', sentinal)
7071
g['endpoint'] = url
7172

7273
if oldvalue:
7374
logger.warn("Value %s for 'endpoint' replaced in global scope "
7475
"for function %s" % (oldvalue, func.__name__))
7576
logger.debug("%s.__globals__['endpoint'] = %s" % (func.__name__, url))
7677

77-
return func(obj, *args, **kwargs)
78+
result = func(obj, *args, **kwargs)
79+
if oldvalue is not sentinal:
80+
g['endpoint'] = oldvalue
81+
return result
7882
return wrapper
7983
return decorator
8084

stackdio/client/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.3"
1+
__version__ = "0.0.6.client.1"

0 commit comments

Comments
 (0)