Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r63804:089736259e98
Date: 2013-05-02 12:21 -0700
http://bitbucket.org/pypy/pypy/changeset/089736259e98/
Log: handle CRLF too for windows
diff --git a/pypy/tool/pytest/apptest.py b/pypy/tool/pytest/apptest.py
--- a/pypy/tool/pytest/apptest.py
+++ b/pypy/tool/pytest/apptest.py
@@ -78,9 +78,10 @@
class ExceptionWrapper:
pass
def raises(exc, func, *args, **kwargs):
+ import os
try:
if isinstance(func, str):
- if func.startswith(" ") or func.startswith("\n"):
+ if func.startswith((' ', os.linesep)):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit