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 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):