two fixes for Jython

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-10-07 08:55:44 +02:00
parent 253c173a88
commit 6b0db18eca
2 changed files with 3 additions and 2 deletions

View File

@ -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. """

View File

@ -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