File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- Enables patching the ``TAG `` preprocessor definition to override
2- :data: `sys.implementation.cache_tag <sys.implementation> ` at build time.
3- Setting it to ``NULL `` has the effect of completely disabling automatic
4- creation and use of ``.pyc `` files.
1+ Enables defining the ``_PY_IMPL_NAME `` and ``_PY_IMPL_CACHE_TAG `` preprocessor
2+ definitions to override :data: `sys.implementation ` at build time. Definitions
3+ need to include quotes when setting to a string literal. Setting the cache tag
4+ to ``NULL `` has the effect of completely disabling automatic creation and use of
5+ ``.pyc `` files.
Original file line number Diff line number Diff line change @@ -3568,18 +3568,20 @@ make_version_info(PyThreadState *tstate)
35683568}
35693569
35703570/* sys.implementation values */
3571- #define NAME "cpython"
3572- const char * _PySys_ImplName = NAME ;
3571+ #ifndef _PY_IMPL_NAME
3572+ #define _PY_IMPL_NAME "cpython"
3573+ #endif
3574+ const char * _PySys_ImplName = _PY_IMPL_NAME ;
3575+ #ifndef _PY_IMPL_CACHE_TAG
35733576#define MAJOR Py_STRINGIFY(PY_MAJOR_VERSION)
35743577#define MINOR Py_STRINGIFY(PY_MINOR_VERSION)
3575- #ifndef TAG
3576- #define TAG NAME "-" MAJOR MINOR
3578+ #define _PY_IMPL_CACHE_TAG NAME "-" MAJOR MINOR
35773579#endif
3578- const char * _PySys_ImplCacheTag = TAG ;
3579- #undef NAME
3580+ const char * _PySys_ImplCacheTag = _PY_IMPL_CACHE_TAG ;
3581+ #ifndef _PY_IMPL_CACHE_TAG
35803582#undef MAJOR
35813583#undef MINOR
3582- #undef TAG
3584+ #endif
35833585
35843586static PyObject *
35853587make_impl_info (PyObject * version_info )
You can’t perform that action at this time.
0 commit comments