Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't leave open handles (important on Jython on Windows)

  • Loading branch information...
commit af8f4b95d662c97ab130fde5177a8843a760ebb2 1 parent 8a90050
@peterjc peterjc authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 Tests/test_PopGen_SimCoal_nodepend.py
View
8 Tests/test_PopGen_SimCoal_nodepend.py
@@ -23,8 +23,12 @@ def test_template_full(self):
'PopGen')
#Confirm the files match (ignoring any switch of line endings
#possible if the input file used a different OS convention)
- old = open(os.path.join('PopGen', 'simple.par'), "rU").readlines()
- new = open(os.path.join('PopGen', 'simple_100_30.par')).readlines()
+ handle = open(os.path.join('PopGen', 'simple.par'), "rU")
+ old = handle.readlines()
+ handle.close()
+ handle = open(os.path.join('PopGen', 'simple_100_30.par'))
+ new = handle.readlines()
+ handle.close()
assert old==new, "Error - Old:\n%s\n\nNew:\n%s\n" % (old, new)
#assert(os.stat('PopGen' + os.sep + 'simple.par').st_size ==
# os.stat('PopGen' + os.sep + 'simple_100_30.par').st_size)
Please sign in to comment.
Something went wrong with that request. Please try again.