Skip to content

Commit

Permalink
Use not PY2 instead of PY3 for python4.x compat (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile authored Aug 25, 2019
1 parent 31b93fa commit 0d0e7dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/tox/_pytestplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __init__(self):

def clear(self):
self._index = -1
if six.PY3:
if not six.PY2:
self.instance.reported_lines.clear()
else:
del self.instance.reported_lines[:]
Expand Down Expand Up @@ -291,7 +291,7 @@ def __init__(self, config):
self.report = ReportExpectMock()

def _clearmocks(self):
if six.PY3:
if not six.PY2:
self._pcalls.clear()
else:
del self._pcalls[:]
Expand Down
2 changes: 1 addition & 1 deletion src/tox/interpreters/py_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __repr__(self):

def __str__(self):
msg = repr(self)
return msg if six.PY3 else msg.encode("utf-8")
return msg.encode("utf-8") if six.PY2 else msg

def satisfies(self, req):
if req.is_abs and self.is_abs and self.path != req.path:
Expand Down

0 comments on commit 0d0e7dd

Please sign in to comment.