Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/cpython/src/sitecustomize.py
1067 views
1
# Install our custom import hook, which imports tar.xz bundles with so in them.
2
try:
3
import cowasm_importer
4
cowasm_importer.init()
5
except ModuleNotFoundError:
6
# python-wasm sometimes is started during the build process before cowasm_importer
7
# is installed. That's the one case where this is safe to silently ignore.
8
pass
9
10
# Revert strange change to Python: https://discuss.python.org/t/int-str-conversions-broken-in-latest-python-bugfix-releases/18889
11
# This was a (potential) security issue for webservers, which isn't relevant for python-wasm.
12
import sys
13
14
sys.set_int_max_str_digits(0)
15
16
# This is very convenient in the context of WASM, where security constraints are different.
17
sys.path.append('.')
18
19