Skip to content

Commit

Permalink
Use str representation of error for python2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Dec 26, 2017
1 parent e24f35a commit 8db4382
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions galpy/orbit_src/OrbitTop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,9 +1240,9 @@ def _setupaA(self,pot=None,type='staeckel',**kwargs):
self._aAPot,self.R(use_physical=False),
self.z(use_physical=False)+(nu.fabs(self.z(use_physical=False)) < 1e-8) * (2.*(self.z(use_physical=False) >= 0)-1.)*1e-10)) # try to make sure this is not 0
except PotentialError as e:
if 'deriv' in repr(e):
if 'deriv' in str(e):
raise PotentialError('Automagic calculation of delta parameter for Staeckel approximation failed because the necessary second derivatives of the given potential are not implemented; set delta= explicitly')
elif 'non-axi' in repr(e):
elif 'non-axi' in str(e):
raise PotentialError('Automagic calculation of delta parameter for Staeckel approximation failed because the given potential is not axisymmetric; pass an axisymmetric potential instead')
else:
raise
Expand Down

0 comments on commit 8db4382

Please sign in to comment.