mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-25 07:43:43 +00:00
Invert PY2/PY3 test for conditional read1() definition
This commit is contained in:
parent
2b5245839c
commit
29ff84a792
@ -16,12 +16,12 @@ import six
|
|||||||
# works here but is only available from Python>=3.3
|
# works here but is only available from Python>=3.3
|
||||||
# - scrapy does not support Python 3.2
|
# - scrapy does not support Python 3.2
|
||||||
# - Python 2.7 GzipFile works fine with standard read() + extrabuf
|
# - Python 2.7 GzipFile works fine with standard read() + extrabuf
|
||||||
if six.PY3:
|
if six.PY2:
|
||||||
def read1(gzf, size=-1):
|
|
||||||
return gzf.read1(size)
|
|
||||||
else:
|
|
||||||
def read1(gzf, size=-1):
|
def read1(gzf, size=-1):
|
||||||
return gzf.read(size)
|
return gzf.read(size)
|
||||||
|
else:
|
||||||
|
def read1(gzf, size=-1):
|
||||||
|
return gzf.read1(size)
|
||||||
|
|
||||||
|
|
||||||
def gunzip(data):
|
def gunzip(data):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user