Skip to content

Commit

Permalink
only get and set acs ind if hasattr
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Nov 6, 2023
1 parent 27e38ba commit 00434d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions prody/proteins/pdbfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,9 @@ def writePDBStream(stream, atoms, csets=None, **kwargs):
NB: ChimeraX seems to prefer hybrid36 and may have problems with hexadecimal.
:type hybrid36: bool
"""
initialACSI = atoms.getACSIndex()
if hasattr(atoms, 'getACSIndex'):
initialACSI = atoms.getACSIndex()

renumber = kwargs.get('renumber', True)

remark = str(atoms)
Expand Down Expand Up @@ -1614,7 +1616,8 @@ def writePDBStream(stream, atoms, csets=None, **kwargs):

write('END ' + " "*74 + '\n')

atoms.setACSIndex(initialACSI)
if hasattr(atoms, 'setACSIndex'):
atoms.setACSIndex(initialACSI)

writePDBStream.__doc__ += _writePDBdoc

Expand Down

0 comments on commit 00434d5

Please sign in to comment.