Path: blob/main/python/cpython/src/sitecustomize.py
1067 views
# Install our custom import hook, which imports tar.xz bundles with so in them.1try:2import cowasm_importer3cowasm_importer.init()4except ModuleNotFoundError:5# python-wasm sometimes is started during the build process before cowasm_importer6# is installed. That's the one case where this is safe to silently ignore.7pass89# Revert strange change to Python: https://discuss.python.org/t/int-str-conversions-broken-in-latest-python-bugfix-releases/1888910# This was a (potential) security issue for webservers, which isn't relevant for python-wasm.11import sys1213sys.set_int_max_str_digits(0)1415# This is very convenient in the context of WASM, where security constraints are different.16sys.path.append('.')171819