diff --git a/python/setup.py.in b/python/setup.py.in index 340691769c..baef4f5554 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -181,7 +181,9 @@ else: # We cannot find the JSBSim library so the Python module must be built from # the sources. if compiler.compiler_type == 'msvc': - compile_flags = [('/D'+flag).replace('"', '\\"') for flag in ['_USE_MATH_DEFINES', 'NOMINMAX', ${JSBSIM_FLAGS}]] + compile_flags = ['/D'+flag for flag in ['_USE_MATH_DEFINES', 'NOMINMAX', ${JSBSIM_FLAGS}]] + if sys.version_info < (3,9): + compile_flags = [flag.replace('"', '\\"') for flag in compile_flags] else: compile_flags = ['-D'+flag for flag in [${JSBSIM_FLAGS}]]