Commit a64e0db6 authored by Jason Swails's avatar Jason Swails
Browse files

Open as binary (needed for Python 3)

parent 645bf229
...@@ -12,7 +12,7 @@ class TestDCDFile(unittest.TestCase): ...@@ -12,7 +12,7 @@ class TestDCDFile(unittest.TestCase):
fname = tempfile.mktemp(suffix='.dcd') fname = tempfile.mktemp(suffix='.dcd')
pdbfile = app.PDBFile('systems/alanine-dipeptide-implicit.pdb') pdbfile = app.PDBFile('systems/alanine-dipeptide-implicit.pdb')
natom = len(list(pdbfile.topology.atoms())) natom = len(list(pdbfile.topology.atoms()))
dcd = app.DCDFile(open(fname, 'w'), pdbfile.topology, 0.001) dcd = app.DCDFile(open(fname, 'wb'), pdbfile.topology, 0.001)
for i in range(5): for i in range(5):
dcd.writeModel([mm.Vec3(random(), random(), random()) for j in range(natom)]*unit.angstroms) dcd.writeModel([mm.Vec3(random(), random(), random()) for j in range(natom)]*unit.angstroms)
dcd._file.close() dcd._file.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment