"platforms/vscode:/vscode.git/clone" did not exist on "a993d7abb91b2403c5834ff15fae7bf431d0227b"
Commit 8bcc9b3d authored by peastman's avatar peastman
Browse files

PdbStructure handles byte streams correctly in Python 3

parent f816d961
...@@ -150,6 +150,8 @@ class PdbStructure(object): ...@@ -150,6 +150,8 @@ class PdbStructure(object):
self._reset_residue_numbers() self._reset_residue_numbers()
# Read one line at a time # Read one line at a time
for pdb_line in input_stream: for pdb_line in input_stream:
if not isinstance(pdb_line, str):
pdb_line = pdb_line.decode('utf-8')
# Look for atoms # Look for atoms
if (pdb_line.find("ATOM ") == 0) or (pdb_line.find("HETATM") == 0): if (pdb_line.find("ATOM ") == 0) or (pdb_line.find("HETATM") == 0):
self._add_atom(Atom(pdb_line, self)) self._add_atom(Atom(pdb_line, self))
......
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