summaryrefslogtreecommitdiff
path: root/test/try_execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-10-30 23:09:39 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-10-30 23:09:39 -0400
commitbb50b8d5c6c50feb676bb5b5f6aecc247c94d7c5 (patch)
treec0bc101902c0845469aaa7da919ba946c0d89158 /test/try_execfile.py
parent8f059350fda7801522e38e34c1e5851d2975fc7f (diff)
downloadpython-coveragepy-bb50b8d5c6c50feb676bb5b5f6aecc247c94d7c5.tar.gz
Make stuff work in other Python versions. Some stuff isn't *quite* right <2.6. #155
Diffstat (limited to 'test/try_execfile.py')
-rw-r--r--test/try_execfile.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/try_execfile.py b/test/try_execfile.py
index 825fdb7..9bbabd1 100644
--- a/test/try_execfile.py
+++ b/test/try_execfile.py
@@ -12,13 +12,18 @@ def my_function(a):
FN_VAL = my_function("fooey")
+try:
+ pkg = __package__
+except NameError:
+ pkg = "*No __package__*"
+
globals_to_check = {
'__name__': __name__,
'__file__': __file__,
'__doc__': __doc__,
'__builtins__.has_open': hasattr(__builtins__, 'open'),
'__builtins__.dir': dir(__builtins__),
- '__package__': __package__,
+ '__package__': pkg,
'DATA': DATA,
'FN_VAL': FN_VAL,
'__main__.DATA': getattr(__main__, "DATA", "nothing"),