Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def test_incomplete_input_error():
assert False, "SyntaxError was not raised"


def test_compile_unrecognised_flags_message():
try:
compile("1", "<input>", "exec", 0x7fffffff)
except ValueError as e:
assert str(e) == "compile(): unrecognised flags"
else:
assert False, "ValueError was not raised"


def test_lambdas_as_function_default_argument_values():
globs = {}
exec("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ private void checkOptimize(int optimize, Object kwOptimize) throws PException {
@TruffleBoundary
private void checkFlags(int flags) {
if ((flags & ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_COMPILE_MASK)) != 0) {
throw PRaiseNode.raiseStatic(this, ValueError, null, NO_VALUE, ErrorMessages.UNRECOGNIZED_FLAGS, PythonUtils.EMPTY_OBJECT_ARRAY);
throw PRaiseNode.raiseStatic(this, ValueError, ErrorMessages.UNRECOGNIZED_FLAGS);
}
}

Expand Down