From 6b0db18eca876b88359388b29195a0821ba00018 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 7 Oct 2010 08:55:44 +0200 Subject: [PATCH] two fixes for Jython --HG-- branch : trunk --- py/_code/code.py | 3 ++- testing/plugin/test_pytest_terminal.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/py/_code/code.py b/py/_code/code.py index b40ef28c4..62c0466ad 100644 --- a/py/_code/code.py +++ b/py/_code/code.py @@ -157,7 +157,8 @@ class TracebackEntry(object): return self.exprinfo def getfirstlinesource(self): - return self.frame.code.firstlineno + # on Jython this firstlineno can be -1 apparently + return max(self.frame.code.firstlineno, 0) def getsource(self): """ return failing source code. """ diff --git a/testing/plugin/test_pytest_terminal.py b/testing/plugin/test_pytest_terminal.py index bbb2a0ab7..02a40188f 100644 --- a/testing/plugin/test_pytest_terminal.py +++ b/testing/plugin/test_pytest_terminal.py @@ -610,7 +610,7 @@ def pytest_report_header(config): "*hello: info*", ]) -needsosdup = py.test.mark.xfail("not hasattr(os, 'dup')") +@py.test.mark.xfail("not hasattr(os, 'dup')") def test_fdopen_kept_alive_issue124(testdir): testdir.makepyfile(""" import os, sys