Skip to content

Commit

Permalink
ENH: Remove deprecation warning from GzipFile wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Nov 18, 2010
1 parent 277c740 commit 8cbed8c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions numpy/lib/npyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ def tell(self):
if isinstance(f, str):
f = GzipFile(f)
elif isinstance(f, gzip.GzipFile):
# cast if its a gzip.GzipFile
mode = f.mode
f = GzipFile(filename=f.filename, fileobj=f.fileobj)
f.mode = mode
# cast to our GzipFile if its already a gzip.GzipFile
g = GzipFile(fileobj=f.fileobj)
g.name = f.name
g.mode = f.mode

f = g

return f

Expand Down

0 comments on commit 8cbed8c

Please sign in to comment.