Commit 5c14022e authored by tic20's avatar tic20
Browse files

PDBxFile only closes input file if it opens it.

parent a52611a8
...@@ -70,12 +70,15 @@ class PDBxFile(object): ...@@ -70,12 +70,15 @@ class PDBxFile(object):
# Load the file. # Load the file.
inputFile = file inputFile = file
ownHandle = False
if isinstance(file, str): if isinstance(file, str):
inputFile = open(file) inputFile = open(file)
ownHandle = True
reader = PdbxReader(inputFile) reader = PdbxReader(inputFile)
data = [] data = []
reader.read(data) reader.read(data)
inputFile.close() if ownHandle:
inputFile.close()
block = data[0] block = data[0]
# Build the topology. # Build the topology.
......
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