Author: Ronan Lamy <[email protected]>
Branch: py3.7
Changeset: r97346:933f6504ecb5
Date: 2019-08-31 01:53 +0100
http://bitbucket.org/pypy/pypy/changeset/933f6504ecb5/

Log:    Gently hack stdlib to avoid unimplemented functions

diff --git a/lib-python/3/os.py b/lib-python/3/os.py
--- a/lib-python/3/os.py
+++ b/lib-python/3/os.py
@@ -129,7 +129,7 @@
     _add("HAVE_FCHMOD",     "chmod")
     _add("HAVE_FCHOWN",     "chown")
     _add("HAVE_FDOPENDIR",  "listdir")
-    _add("HAVE_FDOPENDIR",  "scandir")
+    # _add("HAVE_FDOPENDIR",  "scandir") # not implemented on PyPy yet
     _add("HAVE_FEXECVE",    "execve")
     _set.add(stat) # fstat always works
     _add("HAVE_FTRUNCATE",  "truncate")
diff --git a/lib-python/3/random.py b/lib-python/3/random.py
--- a/lib-python/3/random.py
+++ b/lib-python/3/random.py
@@ -776,7 +776,8 @@
 setstate = _inst.setstate
 getrandbits = _inst.getrandbits
 
-if hasattr(_os, "fork"):
+# PyPy change: we have _os.fork, but not _os.register_at_fork yet
+if hasattr(_os, "register_at_fork"):
     _os.register_at_fork(after_in_child=_inst.seed)
 
 
diff --git a/pypy/module/posix/interp_scandir.py 
b/pypy/module/posix/interp_scandir.py
--- a/pypy/module/posix/interp_scandir.py
+++ b/pypy/module/posix/interp_scandir.py
@@ -11,6 +11,7 @@
 from pypy.module.posix.interp_posix import unwrap_fd, build_stat_result, _WIN32
 
 
+# XXX: update os.supports_fd when fd support is implemented
 def scandir(space, w_path=None):
     "scandir(path='.') -> iterator of DirEntry objects for given path"
     if space.is_none(w_path):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to