zopefoundation / zope.i18nmessageid

Other
1 stars 11 forks source link

Support PURE_PYTHON #28

Open jamadden opened 3 years ago

jamadden commented 3 years ago

Currently, the C extension is unconditionally imported: https://github.com/zopefoundation/zope.i18nmessageid/blob/1d6cc947f45fba4bbed6facf9fea448f5ec4e16b/src/zope/i18nmessageid/message.py#L97-L100

This makes it difficult to test the Python implementation on CPython; you have to remove the dynamic library.

Most Zope projects that have a C extension respect a PURE_PYTHON=1 environment variable to disable importing the C extension. This project should as well.

(See https://github.com/zopefoundation/zope.i18nmessageid/pull/27#issuecomment-883503385)