From 29ff84a7920dd27a7b723f21b68ccc6e2076c08a Mon Sep 17 00:00:00 2001 From: Paul Tremberth Date: Wed, 20 Jan 2016 12:03:38 +0100 Subject: [PATCH] Invert PY2/PY3 test for conditional read1() definition --- scrapy/utils/gz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scrapy/utils/gz.py b/scrapy/utils/gz.py index d69fb598d..d035f9fdf 100644 --- a/scrapy/utils/gz.py +++ b/scrapy/utils/gz.py @@ -16,12 +16,12 @@ import six # works here but is only available from Python>=3.3 # - scrapy does not support Python 3.2 # - Python 2.7 GzipFile works fine with standard read() + extrabuf -if six.PY3: - def read1(gzf, size=-1): - return gzf.read1(size) -else: +if six.PY2: def read1(gzf, size=-1): return gzf.read(size) +else: + def read1(gzf, size=-1): + return gzf.read1(size) def gunzip(data):