aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/doctest.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-06-18 14:08:20 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-06-18 14:08:20 -0500
commita85aa143f971ebfbb31ccaf58cb82a311f9315c6 (patch)
treeeeae1529ae15884aca3301fefae768fc2e531a18 /setuptools/tests/doctest.py
parent94fc39cb62df19e85b07658f2fa5d0b4a7bf9303 (diff)
parent641eac6550896506fa939205f249bcfb8f057d57 (diff)
downloadexternal_python_setuptools-a85aa143f971ebfbb31ccaf58cb82a311f9315c6.tar.gz
external_python_setuptools-a85aa143f971ebfbb31ccaf58cb82a311f9315c6.tar.bz2
external_python_setuptools-a85aa143f971ebfbb31ccaf58cb82a311f9315c6.zip
Merge Vinay Sajip's unified Python 2/3 support from distribute 3
--HG-- branch : distribute
Diffstat (limited to 'setuptools/tests/doctest.py')
-rw-r--r--setuptools/tests/doctest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/tests/doctest.py b/setuptools/tests/doctest.py
index 1f23fd8e..35d588d0 100644
--- a/setuptools/tests/doctest.py
+++ b/setuptools/tests/doctest.py
@@ -1968,7 +1968,9 @@ def testfile(filename, module_relative=True, name=None, package=None,
runner = DocTestRunner(verbose=verbose, optionflags=optionflags)
# Read the file, convert it to a test, and run it.
- s = open(filename).read()
+ f = open(filename)
+ s = f.read()
+ f.close()
test = parser.get_doctest(s, globs, name, filename, 0)
runner.run(test)
@@ -2353,7 +2355,9 @@ def DocFileTest(path, module_relative=True, package=None,
# Find the file and read it.
name = os.path.basename(path)
- doc = open(path).read()
+ f = open(path)
+ doc = f.read()
+ f.close()
# Convert it to a test, and wrap it in a DocFileCase.
test = parser.get_doctest(doc, globs, name, path, 0)