Skip to content

Commit

Permalink
fix python2 compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-miller committed Nov 19, 2019
1 parent 07f5550 commit 60d6fa4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Bio/PDB/ic_rebuild.py
Expand Up @@ -7,7 +7,12 @@
"""Convert XYZ Structure to internal coordinates and back, test result."""

import re
import itertools
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest

# import itertools

try:
import numpy
Expand Down Expand Up @@ -281,9 +286,9 @@ def compare_residues(e0, e1, verbose=False):
cmpdict["pass"] = None
cmpdict["report"] = None

for r0, r1 in itertools.zip_longest(e0.get_residues(), e1.get_residues()):
for r0, r1 in zip_longest(e0.get_residues(), e1.get_residues()):
if 2 == r0.is_disordered() == r1.is_disordered():
for dr0, dr1 in itertools.zip_longest(
for dr0, dr1 in zip_longest(
r0.child_dict.values(), r1.child_dict.values()
):
_cmp_res(dr0, dr1, verbose, cmpdict)
Expand Down
4 changes: 2 additions & 2 deletions Bio/PDB/internal_coords.py
Expand Up @@ -2004,7 +2004,7 @@ def __init__(self, *args, **kwargs):
As for Edron, plus optional 'len1', 'angle2', 'len3'
keyworded values.
"""
super().__init__(*args, **kwargs)
super(Hedron, self).__init__(*args, **kwargs)

# print('initialising', self.id)

Expand Down Expand Up @@ -2202,7 +2202,7 @@ def __init__(self, *args, **kwargs):
Acceptable input:
As for Edron, plus optional 'dihedral1' keyworded angle value.
"""
super().__init__(*args, **kwargs)
super(Dihedron, self).__init__(*args, **kwargs)

# hedra making up this dihedron; set by self:_set_hedra()
self.hedron1 = None
Expand Down

0 comments on commit 60d6fa4

Please sign in to comment.