Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r83801:9ba0ca55f93a
Date: 2016-04-20 18:52 -0700
http://bitbucket.org/pypy/pypy/changeset/9ba0ca55f93a/

Log:    translation fixes for osx

diff --git a/pypy/module/posix/interp_posix.py 
b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -1023,11 +1023,11 @@
 dir_fd may not be implemented on your platform.
   If it is unavailable, using it will raise a NotImplementedError."""
     try:
-        if dir_fd == DEFAULT_DIR_FD:
-            dispatch_filename(rposix.mkfifo)(space, w_path, mode)
-        else:
+        if rposix.HAVE_MKFIFOAT and dir_fd != DEFAULT_DIR_FD:
             path = space.fsencode_w(w_path)
             rposix.mkfifoat(path, mode, dir_fd)
+        else:
+            dispatch_filename(rposix.mkfifo)(space, w_path, mode)
     except OSError as e:
         raise wrap_oserror2(space, e, w_path)
 
@@ -1047,11 +1047,11 @@
 dir_fd may not be implemented on your platform.
   If it is unavailable, using it will raise a NotImplementedError."""
     try:
-        if dir_fd == DEFAULT_DIR_FD:
-            dispatch_filename(rposix.mknod)(space, w_filename, mode, device)
-        else:
+        if rposix.HAVE_MKNODAT and dir_fd != DEFAULT_DIR_FD:
             fname = space.fsencode_w(w_filename)
             rposix.mknodat(fname, mode, device, dir_fd)
+        else:
+            dispatch_filename(rposix.mknod)(space, w_filename, mode, device)
     except OSError as e:
         raise wrap_oserror2(space, e, w_filename)
 
@@ -1405,7 +1405,7 @@
         atime_s, atime_ns = convert_ns(space, args_w[0])
         mtime_s, mtime_ns = convert_ns(space, args_w[1])
 
-    if path.as_fd != -1:
+    if rposix.HAVE_FUTIMENS and path.as_fd != -1:
         if dir_fd != DEFAULT_DIR_FD:
             raise oefmt(space.w_ValueError,
                         "utime: can't specify both dir_fd and fd")
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to