Skip to content

Commit

Permalink
Use feature detection instead of version detection (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored and joschu committed Feb 3, 2018
1 parent c21f09f commit 687a65f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gym/error.py
Expand Up @@ -90,12 +90,11 @@ def __unicode__(self):
else:
return self._message

if sys.version_info > (3, 0):
def __str__(self):
return self.__unicode__()
else:
def __str__(self):
def __str__(self):
try: # Python 2
return unicode(self).encode('utf-8')
except NameError: # Python 3
return self.__unicode__()


class APIConnectionError(APIError):
Expand Down

0 comments on commit 687a65f

Please sign in to comment.