summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2018-09-22 23:35:49 +0200
committerRobert Bradshaw <robertwb@gmail.com>2018-09-22 23:35:49 +0200
commitc24b62b103712011a91495dab10dd1b2298f2bb5 (patch)
treeb4e1101aa7414cd1278e935116d083aba2e8b3f4
parente79ace99c4a59d4acddcc4460d042911f9911df8 (diff)
downloadcython-c24b62b103712011a91495dab10dd1b2298f2bb5.tar.gz
Wrap some long lines.
-rw-r--r--Cython/Compiler/ExprNodes.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index a3183cc96..9c8cab8a3 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -196,11 +196,20 @@ def get_exception_handler(exception_value):
and exception_value.value == '*'):
return "__Pyx_CppExn2PyErr();", True
elif exception_value.type.is_pyobject:
- return 'try { throw; } catch(const std::exception& exn) { PyErr_SetString(%s, exn.what()); } catch(...) { PyErr_SetNone(%s); }' % (
- exception_value.entry.cname,
- exception_value.entry.cname), False
+ return (
+ 'try { throw; } catch(const std::exception& exn) {'
+ 'PyErr_SetString(%s, exn.what());'
+ '} catch(...) { PyErr_SetNone(%s); }' % (
+ exception_value.entry.cname,
+ exception_value.entry.cname),
+ False)
else:
- return '%s(); if (!PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError , "Error converting c++ exception.");' % exception_value.entry.cname, False
+ return (
+ '%s(); if (!PyErr_Occurred())'
+ 'PyErr_SetString(PyExc_RuntimeError, '
+ '"Error converting c++ exception.");' % (
+ exception_value.entry.cname),
+ False)
def maybe_check_py_error(code, check_py_exception, pos, nogil):
if check_py_exception: