We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97f813e commit 4fa7d56Copy full SHA for 4fa7d56
Lib/idlelib/idle_test/test_run.py
@@ -45,14 +45,18 @@ def __eq__(self, other):
45
('int.reel', AttributeError,
46
"type object 'int' has no attribute 'reel'. "
47
"Did you mean: 'real'?\n"),
48
+ (r'raise NameError("123\n456")', NameError, "123\n456\n"),
49
)
50
51
@force_not_colorized
52
def test_get_message(self):
53
for code, exc, msg in self.data:
54
with self.subTest(code=code):
55
try:
- eval(compile(code, '', 'eval'))
56
+ if "raise" not in code:
57
+ eval(compile(code, '', 'eval'))
58
+ else:
59
+ exec(compile(code, '', 'exec')) # code r"raise NameError("123\n456")" cannot run in "eval" mode: SyntaxError
60
except exc:
61
typ, val, tb = sys.exc_info()
62
actual = run.get_message_lines(typ, val, tb)[0]
0 commit comments