Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some python2.5 compatibility code #3529

merged 4 commits into from Jun 4, 2018
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+7 −8
Diff settings


Just for now

Copy path View file
@@ -0,0 +1 @@
Remove some python2.5 compatibility code.
Copy path View file
@@ -83,7 +83,7 @@ def iscoroutinefunction(func):

def getlocation(function, curdir):
fn = py.path.local(inspect.getfile(function))
lineno = py.builtin._getcode(function).co_firstlineno
lineno = function.__code__.co_firstlineno
if fn.relto(curdir):
fn = fn.relto(curdir)
return "%s:%d" % (fn, lineno + 1)
Copy path View file
@@ -354,8 +354,7 @@ def instance(self):
return self._pyfuncitem._testcase
except AttributeError:
function = getattr(self, "function", None)
if function is not None:
return py.builtin._getimself(function)
return getattr(function, "__self__", None)

def module(self):
Copy path View file
@@ -13,6 +13,7 @@
from six.moves import queue

from test_source import astonly

@@ -23,8 +24,6 @@
invalidate_import_caches = getattr(importlib, "invalidate_caches", None)

queue = py.builtin._tryimport("queue", "Queue")

failsonjython = pytest.mark.xfail("sys.platform.startswith('java')")

pytest_version_info = tuple(map(int, pytest.__version__.split(".")[:3]))
Copy path View file
@@ -546,9 +546,9 @@ def test_mojibake(self):
# issue 429
left = "e"
right = "\xc3\xa9"
if not isinstance(left, py.builtin.bytes):
left = py.builtin.bytes(left, "utf-8")
right = py.builtin.bytes(right, "utf-8")
if not isinstance(left, bytes):
left = bytes(left, "utf-8")
right = bytes(right, "utf-8")
expl = callequal(left, right)
for line in expl:
assert isinstance(line, py.builtin.text)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.