Skip to content

Commit c1056a6

Browse files
committed
use six.PY2 instead of homegrown utility
1 parent 3026199 commit c1056a6

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

scrapyrt/utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ def extract_scrapy_request_args(dictionary, raise_error=False):
2525
return result
2626

2727

28-
def is_python2():
29-
return sys.version_info < (3,0)
30-
31-
3228
try:
3329
from scrapy.utils.python import to_bytes
3430
except ImportError:

tests/servers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
import six
23
from subprocess import Popen, PIPE
34
from six.moves.urllib.parse import urljoin
45
import fcntl
@@ -11,7 +12,6 @@
1112

1213
import port_for
1314

14-
from scrapyrt.utils import is_python2
1515
from . import SAMPLE_DATA
1616
from .utils import get_testenv, generate_project
1717

@@ -30,7 +30,7 @@ def __init__(self, host='localhost', port=None, cwd=None, shell=False,
3030
self.stdin = stdin
3131
self.stdout = stdout
3232
self.stderr = stderr
33-
if is_python2():
33+
if six.PY2:
3434
command = 'SimpleHTTPServer'
3535
else:
3636
command = 'http.server'

0 commit comments

Comments
 (0)