summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/doctest.py8
-rw-r--r--setuptools/tests/test_sandbox.py2
2 files changed, 6 insertions, 4 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)
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py
index 3dad1376..06b3d434 100644
--- a/setuptools/tests/test_sandbox.py
+++ b/setuptools/tests/test_sandbox.py
@@ -72,7 +72,7 @@ class TestSandbox(unittest.TestCase):
target = pkg_resources.resource_filename(__name__,
'script-with-bom.py')
namespace = types.ModuleType('namespace')
- setuptools.sandbox.execfile(target, vars(namespace))
+ setuptools.sandbox._execfile(target, vars(namespace))
assert namespace.result == 'passed'
if __name__ == '__main__':