Skip to content

Commit

Permalink
fix unicode problem in snapshot.open
Browse files Browse the repository at this point in the history
  • Loading branch information
apetri committed Oct 15, 2016
1 parent 4687e57 commit bc57e64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lenstools/simulations/nbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def open(cls,filename,pool=None,header_kwargs=dict(),**kwargs):
"""

if type(filename)==str:
if hasattr(filename,"format"):

fp = open(cls.buildFilename(filename,pool,**kwargs),"rb")

Expand All @@ -201,7 +201,7 @@ def open(cls,filename,pool=None,header_kwargs=dict(),**kwargs):
fp = filename

else:
raise TypeError("filename must be string or file!")
raise TypeError("filename type is {0}, must be string or file!".format(type(filename)))

return cls(fp,pool,header_kwargs=header_kwargs)

Expand Down

0 comments on commit bc57e64

Please sign in to comment.