Skip to content

Commit

Permalink
fix release_print
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuizi7 committed Nov 16, 2020
1 parent 9e9708e commit 504a07c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rqalpha/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def user_print(*args, **kwargs):
def release_print(scope):
for func in scope.values():
if hasattr(func, "__globals__"):
print_funt = func.__globals__.get('print')
if print_funt is not None and print_funt.__name__ == user_print.__name__:
try:
print_func = func.__globals__.get('print')
except RuntimeError:
# DummyRQDatac
continue
if print_func is not None and print_func.__name__ == user_print.__name__:
func.__globals__['print'] = original_print

0 comments on commit 504a07c

Please sign in to comment.