Remove NoContext
This commit is contained in:
parent
05b20d4987
commit
904d14d4cf
|
@ -2,9 +2,6 @@ import inspect
|
||||||
import re
|
import re
|
||||||
from itertools import combinations
|
from itertools import combinations
|
||||||
|
|
||||||
class NoContext:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def trace_back(name=None):
|
def trace_back(name=None):
|
||||||
l = []
|
l = []
|
||||||
frame = inspect.currentframe().f_back.f_back
|
frame = inspect.currentframe().f_back.f_back
|
||||||
|
@ -13,7 +10,7 @@ def trace_back(name=None):
|
||||||
obj = frame.f_locals["self"]
|
obj = frame.f_locals["self"]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
obj = None
|
obj = None
|
||||||
if obj is None or isinstance(obj, NoContext):
|
if obj is None:
|
||||||
modules = frame.f_globals["__name__"]
|
modules = frame.f_globals["__name__"]
|
||||||
modules = modules.split(".")
|
modules = modules.split(".")
|
||||||
obj = modules[len(modules)-1]
|
obj = modules[len(modules)-1]
|
||||||
|
|
Loading…
Reference in New Issue