aboutsummaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2011-03-06 09:25:40 +0100
committerholger krekel <holger@merlinux.eu>2011-03-06 09:25:40 +0100
commit1ba1e3fabee7550dbec4fbaa29509f26028922b5 (patch)
tree96340fc090285cddbb8a6ba12f69bc70b996b0c0 /py
parentmerge default (diff)
downloadpypy-1ba1e3fabee7550dbec4fbaa29509f26028922b5.tar.gz
pypy-1ba1e3fabee7550dbec4fbaa29509f26028922b5.tar.bz2
pypy-1ba1e3fabee7550dbec4fbaa29509f26028922b5.zip
update to current py and pytest trunk
Diffstat (limited to 'py')
-rw-r--r--py/__init__.py3
-rw-r--r--py/_code/_assertionnew.py17
-rw-r--r--py/_code/source.py2
-rw-r--r--py/_error.py2
-rw-r--r--py/_path/local.py10
5 files changed, 13 insertions, 21 deletions
diff --git a/py/__init__.py b/py/__init__.py
index cf22e254de..08a575b6a7 100644
--- a/py/__init__.py
+++ b/py/__init__.py
@@ -8,7 +8,7 @@ dictionary or an import path.
(c) Holger Krekel and others, 2004-2010
"""
-__version__ = '1.4.1.dev2'
+__version__ = '1.4.2.dev0'
from py import _apipkg
@@ -145,4 +145,3 @@ _apipkg.initpkg(__name__, attr={'_apipkg': _apipkg}, exportdefs={
},
})
-
diff --git a/py/_code/_assertionnew.py b/py/_code/_assertionnew.py
index 77c06c8a0e..afb1b31ff0 100644
--- a/py/_code/_assertionnew.py
+++ b/py/_code/_assertionnew.py
@@ -267,20 +267,9 @@ class DebugInterpreter(ast.NodeVisitor):
result = self.frame.eval(co, **ns)
except Exception:
raise Failure(explanation)
- # Only show result explanation if it's not a builtin call or returns a
- # bool.
- if not isinstance(call.func, ast.Name) or \
- not self._is_builtin_name(call.func):
- source = "isinstance(__exprinfo_value, bool)"
- co = self._compile(source)
- try:
- is_bool = self.frame.eval(co, __exprinfo_value=result)
- except Exception:
- is_bool = False
- if not is_bool:
- pattern = "%s\n{%s = %s\n}"
- rep = self.frame.repr(result)
- explanation = pattern % (rep, rep, explanation)
+ pattern = "%s\n{%s = %s\n}"
+ rep = self.frame.repr(result)
+ explanation = pattern % (rep, rep, explanation)
return explanation, result
def _is_builtin_name(self, name):
diff --git a/py/_code/source.py b/py/_code/source.py
index 15c8e023e3..6717e9cce9 100644
--- a/py/_code/source.py
+++ b/py/_code/source.py
@@ -215,7 +215,7 @@ class Source(object):
msglines = self.lines[:ex.lineno]
if ex.offset:
msglines.append(" "*ex.offset + '^')
- msglines.append("syntax error probably generated here: %s" % filename)
+ msglines.append("(code was compiled probably from here: %s)" % filename)
newex = SyntaxError('\n'.join(msglines))
newex.offset = ex.offset
newex.lineno = ex.lineno
diff --git a/py/_error.py b/py/_error.py
index 1062bbacf6..a9085106b8 100644
--- a/py/_error.py
+++ b/py/_error.py
@@ -37,6 +37,8 @@ class ErrorMaker(object):
_errno2class = {}
def __getattr__(self, name):
+ if name[0] == "_":
+ raise AttributeError(name)
eno = getattr(errno, name)
cls = self._geterrnoclass(eno)
setattr(self, name, cls)
diff --git a/py/_path/local.py b/py/_path/local.py
index fbe3ae5eb5..ab291d297a 100644
--- a/py/_path/local.py
+++ b/py/_path/local.py
@@ -158,11 +158,13 @@ class LocalPath(FSBase):
def samefile(self, other):
""" return True if 'other' references the same file as 'self'. """
+ if not iswin32:
+ return py.error.checked_call(
+ os.path.samefile, str(self), str(other))
if self == other:
return True
- if not iswin32:
- return py.error.checked_call(os.path.samefile, str(self), str(other))
- return False
+ other = os.path.abspath(str(other))
+ return self == other
def remove(self, rec=1, ignore_errors=False):
""" remove a file or directory (or a directory tree if rec=1).
@@ -747,7 +749,7 @@ class LocalPath(FSBase):
pass
try:
os.symlink(src, dest)
- except (OSError, AttributeError): # AttributeError on win32
+ except (OSError, AttributeError, NotImplementedError):
pass
return udir