summaryrefslogtreecommitdiff
path: root/tests/try_execfile.py
diff options
context:
space:
mode:
authorBuck Golemon <buck@yelp.com>2014-11-14 16:33:41 -0800
committerBuck Golemon <buck@yelp.com>2014-11-14 16:33:41 -0800
commit0166806295cdfcc525534d25e331e1f9852cbd5f (patch)
tree4352de9fbd3c36cf85f3b693fdf4df564deaafc2 /tests/try_execfile.py
parenteafbacf36a5ab26e44666c8477f7fdc0284bd068 (diff)
downloadpython-coveragepy-0166806295cdfcc525534d25e331e1f9852cbd5f.tar.gz
they changed the way __loader__ looks in 3.3
Diffstat (limited to 'tests/try_execfile.py')
-rw-r--r--tests/try_execfile.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/try_execfile.py b/tests/try_execfile.py
index fd430e6..ee5bae5 100644
--- a/tests/try_execfile.py
+++ b/tests/try_execfile.py
@@ -54,14 +54,17 @@ def my_function(a):
FN_VAL = my_function("fooey")
+loader = globals().get('__loader__')
+fullname = getattr(loader, 'fullname', None) or getattr(loader, 'name', None)
+
globals_to_check = {
'__name__': __name__,
'__file__': __file__,
'__doc__': __doc__,
'__builtins__.has_open': hasattr(__builtins__, 'open'),
'__builtins__.dir': dir(__builtins__),
- '__loader__ exists': '__loader__' in globals(),
- '__loader__.fullname': getattr(globals().get('__loader__', None), 'fullname', None),
+ '__loader__ exists': loader is not None,
+ '__loader__.fullname': fullname,
'__package__': __package__,
'DATA': DATA,
'FN_VAL': FN_VAL,