Skip to content
Draft
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 @@ -133,3 +133,9 @@ def test_getwindowsversion_java_backend(self):
capture_output=True, text=True, check=True,
)
self.assertEqual(result.stdout.splitlines(), [str(expected), str(expected)])


class SysFlagsTests(unittest.TestCase):
def test_debug_is_zero_by_default(self):
# CPython sets sys.flags.debug only when -d is given, not from -O.
self.assertEqual(sys.flags.debug, 0)
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ public void postInitialize0(Python3Core core) {
PList sysPaths = PFactory.createList(language, path);
sys.setAttribute(tsInternedLiteral("path"), sysPaths);
sys.setAttribute(tsInternedLiteral("flags"), PFactory.createStructSeq(language, SysModuleBuiltins.FLAGS_DESC,
PInt.intValue(!language.getEngineOption(PythonOptions.PythonOptimizeFlag)), // debug
0, // debug
PInt.intValue(context.getOption(PythonOptions.InspectFlag)), // inspect
PInt.intValue(context.getOption(PythonOptions.TerminalIsInteractive)), // interactive
PInt.intValue(language.getEngineOption(PythonOptions.PythonOptimizeFlag)), // optimize
Expand Down