Skip to content

Commit efbe75e

Browse files
committed
Use six.PY2 also for conditional imports
1 parent 25401fd commit efbe75e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scrapy/utils/url.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from six.moves.urllib.parse import (ParseResult, urlunparse, urldefrag,
1212
urlparse, parse_qsl, urlencode,
1313
quote, unquote)
14-
if six.PY3:
14+
if not six.PY2:
1515
from urllib.parse import unquote_to_bytes
1616

1717
# scrapy.utils.url was moved to w3lib.url and import * ensures this
@@ -157,7 +157,7 @@ def parse_url(http://github.com/url,%20encoding=None):
157157
return urlparse(to_unicode(url, encoding))
158158

159159

160-
if six.PY3:
160+
if not six.PY2:
161161
from urllib.parse import _coerce_args, unquote_to_bytes
162162

163163
def parse_qsl_to_bytes(qs, keep_blank_values=False, strict_parsing=False):

0 commit comments

Comments
 (0)