aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/doctest.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-07-05 14:42:49 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-07-05 14:42:49 -0400
commitc4ecbd1e58a3384a5ab730450fa5487e48b68721 (patch)
tree48c2ea3b73cd70fdb47d2c1e4d2ee966c36b5377 /setuptools/tests/doctest.py
parentf3829d8bd0cd852be133f8822aa4493a7a12fd51 (diff)
downloadexternal_python_setuptools-c4ecbd1e58a3384a5ab730450fa5487e48b68721.tar.gz
external_python_setuptools-c4ecbd1e58a3384a5ab730450fa5487e48b68721.tar.bz2
external_python_setuptools-c4ecbd1e58a3384a5ab730450fa5487e48b68721.zip
Since Python 3 will always need the _execfile functionality (to fulfill the test in test_sandbox), this functionality should become part of the core implementation.
Diffstat (limited to 'setuptools/tests/doctest.py')
-rw-r--r--setuptools/tests/doctest.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/setuptools/tests/doctest.py b/setuptools/tests/doctest.py
index 47293c3c..75a1ff54 100644
--- a/setuptools/tests/doctest.py
+++ b/setuptools/tests/doctest.py
@@ -109,7 +109,8 @@ import __future__
import sys, traceback, inspect, linecache, os, re, types
import unittest, difflib, pdb, tempfile
import warnings
-from setuptools.compat import StringIO, execfile, func_code, im_func
+from setuptools.compat import StringIO, func_code, im_func
+from setuptools import sandbox
# Don't whine about the deprecated is_private function in this
# module's tests.
@@ -2554,14 +2555,15 @@ def debug_script(src, pm=False, globs=None):
if pm:
try:
- execfile(srcfilename, globs, globs)
+ sandbox._execfile(srcfilename, globs)
except:
print(sys.exc_info()[1])
pdb.post_mortem(sys.exc_info()[2])
else:
# Note that %r is vital here. '%s' instead can, e.g., cause
# backslashes to get treated as metacharacters on Windows.
- pdb.run("execfile(%r)" % srcfilename, globs, globs)
+ cmd = "sandbox._execfile(%r, globals())" % srcfilename
+ pdb.run(cmd, globs, globs)
finally:
os.remove(srcfilename)