File tree 1 file changed +3
-13
lines changed 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -67,26 +67,16 @@ def readinto(self, buf):
67
67
return n_read
68
68
69
69
70
- def _gzip_open (fileish , mode = 'rb' , compresslevel = 9 ):
71
-
72
- # is this a file? if not we assume it is a string
73
- is_file = hasattr (fileish , 'read' ) and hasattr (fileish , 'write' )
74
-
75
- # If we've been given a file object, we can't change its mode.
76
- if is_file and hasattr (fileish , 'mode' ):
77
- mode = fileish .mode
70
+ def _gzip_open (filename , mode = 'rb' , compresslevel = 9 ):
78
71
79
72
# use indexed_gzip if possible for faster read access
80
73
if mode == 'rb' and HAVE_INDEXED_GZIP :
81
- if is_file :
82
- gzip_file = SafeIndexedGzipFile (fid = fileish )
83
- else :
84
- gzip_file = SafeIndexedGzipFile (filename = fileish )
74
+ gzip_file = SafeIndexedGzipFile (filename )
85
75
86
76
# Fall-back to built-in GzipFile (wrapped with the BufferedGzipFile class
87
77
# defined above)
88
78
else :
89
- gzip_file = BufferedGzipFile (fileish , mode , compresslevel )
79
+ gzip_file = BufferedGzipFile (filename , mode , compresslevel )
90
80
91
81
# Speedup for #209, for versions of python < 3.5. Open gzip files with
92
82
# faster reads on large files using a larger read buffer. See
You can’t perform that action at this time.
0 commit comments