From 270faca6c9fc147a2e2265644bc21f671361f4c3 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 26 Nov 2024 21:14:31 +0100 Subject: [PATCH] Remove any usage of __PYTHRAN__ macro It was only used once, as a legacy of Python 2 support (see 36d11d0d351d846b1a977746350f2d182ea21671 for the origin of the remaining piece of code). This should make #2257 easier too. --- pythran/config.py | 2 -- pythran/pythonic/builtins/oct.hpp | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/pythran/config.py b/pythran/config.py index a00b8fcad..873da77d6 100644 --- a/pythran/config.py +++ b/pythran/config.py @@ -197,8 +197,6 @@ def parse_define(define): if python: extension['define_macros'].append('ENABLE_PYTHON_MODULE') - extension['define_macros'].append( - '__PYTHRAN__={}'.format(sys.version_info.major)) pythonic_dir = get_include() diff --git a/pythran/pythonic/builtins/oct.hpp b/pythran/pythonic/builtins/oct.hpp index 9150c7906..791d28115 100644 --- a/pythran/pythonic/builtins/oct.hpp +++ b/pythran/pythonic/builtins/oct.hpp @@ -17,13 +17,7 @@ namespace builtins types::str oct(T const &v) { std::ostringstream oss; - oss << -#if defined(__PYTHRAN__) && __PYTHRAN__ == 3 - "0o" -#else - '0' -#endif - << std::oct << v; + oss << "0o" << std::oct << v; return oss.str(); } } // namespace builtins