Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/py-pip/src/patches/01-pip-no-mmap.patch
1067 views
1
--- native/src/pip/_vendor/cachecontrol/filewrapper.py 2022-11-30 22:08:59
2
+++ wasm/src/pip/_vendor/cachecontrol/filewrapper.py 2022-11-30 22:10:05
3
@@ -69,6 +69,10 @@
4
# relying on Python's buffer API and mmap(). mmap() just gives
5
# a view directly into the filesystem's memory cache, so it
6
# doesn't result in duplicate memory use.
7
+
8
+ # CoWasm: Temporary hack to avoid using mmap.
9
+ return self.__buf.read()
10
+
11
self.__buf.seek(0, 0)
12
result = memoryview(
13
mmap.mmap(self.__buf.fileno(), 0, access=mmap.ACCESS_READ)
14
15