From c3ffa482aff529b6903aa2d05062380f25bff4f2 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 26 Mar 2022 09:22:43 -0700 Subject: [PATCH 1/2] Try to fix Windows build Fixes #12460 --- mypyc/build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypyc/build.py b/mypyc/build.py index 8528aa088ac05..1cd6d109f0d0d 100644 --- a/mypyc/build.py +++ b/mypyc/build.py @@ -525,8 +525,9 @@ def mypycify( elif compiler.compiler_type == 'msvc': if opt_level == '3': opt_level = '2' + if opt_level != '0': + cflags.append('/O{}'.format(opt_level)) cflags += [ - '/O{}'.format(opt_level), '/wd4102', # unreferenced label '/wd4101', # unreferenced local variable '/wd4146', # negating unsigned int From 22d184fca219120f0b9d429336d256ac86a31af8 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 26 Mar 2022 10:02:33 -0700 Subject: [PATCH 2/2] maybe make the assertion better --- mypyc/test/test_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py index a5e356ea56a6e..d390a8a9501a4 100644 --- a/mypyc/test/test_run.py +++ b/mypyc/test/test_run.py @@ -263,7 +263,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) -> # Assert that an output file got created suffix = 'pyd' if sys.platform == 'win32' else 'so' - assert glob.glob('native.*.{}'.format(suffix)) + assert glob.glob('native.*.{}'.format(suffix)), list(os.listdir(".")) driver_path = 'driver.py' if not os.path.isfile(driver_path):