summaryrefslogtreecommitdiff
path: root/unitTests.py
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-10-30 12:06:06 +0100
committerGitHub <noreply@github.com>2018-10-30 12:06:06 +0100
commit7b2e0a4f96935eac91d749cf0d9dfb4b33101d63 (patch)
tree5a064d61cc3489c65cd594cd403db80b06e912de /unitTests.py
parent0277d2eb983c0ab1595994f52d8ac70d253c61f0 (diff)
downloadpyparsing-git-7b2e0a4f96935eac91d749cf0d9dfb4b33101d63.tar.gz
Undefined name: file() was removed in Python 3
__file()__ was removed as a builtin in Python 3 so this PR advocates the use of __open()__ instead. Also note that four lines above, __testclass__ is an _undefined name_ and perhaps __testclasses__ should be used in its place. Undefined names have the potential to raise NameError at runtime.
Diffstat (limited to 'unitTests.py')
-rw-r--r--unitTests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/unitTests.py b/unitTests.py
index a32f6dc..83dd08c 100644
--- a/unitTests.py
+++ b/unitTests.py
@@ -3902,7 +3902,7 @@ if console:
else:
# HTML mode
outfile = "testResults.html"
- outstream = file(outfile,"w")
+ outstream = open(outfile,"w")
testRunner = HTMLTestRunner.HTMLTestRunner( stream=outstream )
testRunner.run( makeTestSuite() )
outstream.close()