We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 818dad8 commit f5a81c2Copy full SHA for f5a81c2
1 file changed
pythonpy/__main__.py
@@ -190,7 +190,7 @@ def format(output):
190
191
if args.post_cmd:
192
exec(args.post_cmd)
193
-except Exception:
+except Exception as ex:
194
import traceback
195
pyheader = 'File "{}"'.format(__file__)
196
exprheader = 'File "<string>"'
@@ -200,7 +200,7 @@ def format(output):
200
if line.lstrip().startswith(pyheader):
201
continue
202
sys.stderr.write(line)
203
- if not foundexpr and line.lstrip().startswith(exprheader):
+ if not foundexpr and line.lstrip().startswith(exprheader) and not isinstance(ex, SyntaxError):
204
sys.stderr.write(' {}\n'.format(args.expression))
205
foundexpr = True
206
0 commit comments