Skip to content

Commit

Permalink
Update asg.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pfernique committed Nov 2, 2017
1 parent ef0fb11 commit d5bf7d5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/py/autowig/asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ def parent(self):
.. warning:: The parent directory is `None` only for the system root directory
"""
if self._node == os.path.abspath(os.sep):
return None
elif self._node in ["/", "\\"]:
return None
else:
return self._asg[self.globalname[:len(self.globalname)-len(self.localname)]]
try:
if self._node == os.path.abspath(os.sep):
return None
elif self._node in ["/", "\\"]:
return None
else:
return self._asg[self.globalname[:len(self.globalname)-len(self.localname)]]
except Exception as e:
print self._node
raise e

def relpath(self, location):
"""Compute the relative path from the directory to the given location
Expand Down

0 comments on commit d5bf7d5

Please sign in to comment.