Author: Armin Rigo <[email protected]>
Branch:
Changeset: r88893:08ec669ddab9
Date: 2016-12-06 10:53 +0100
http://bitbucket.org/pypy/pypy/changeset/08ec669ddab9/
Log: Normalize these macros (John Zhang on pypy-dev): instead of
protecting the calls with @jit.dont_look_inside, use the modern way,
which is the macro=True keyword arg.
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -1779,22 +1779,19 @@
lltype.free(l_utsbuf, flavor='raw')
# These are actually macros on some/most systems
-c_makedev = external('makedev', [rffi.INT, rffi.INT], rffi.INT)
-c_major = external('major', [rffi.INT], rffi.INT)
-c_minor = external('minor', [rffi.INT], rffi.INT)
+c_makedev = external('makedev', [rffi.INT, rffi.INT], rffi.INT, macro=True)
+c_major = external('major', [rffi.INT], rffi.INT, macro=True)
+c_minor = external('minor', [rffi.INT], rffi.INT, macro=True)
@replace_os_function('makedev')
[email protected]_look_inside
def makedev(maj, min):
return c_makedev(maj, min)
@replace_os_function('major')
[email protected]_look_inside
def major(dev):
return c_major(dev)
@replace_os_function('minor')
[email protected]_look_inside
def minor(dev):
return c_minor(dev)
diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py
--- a/rpython/rlib/test/test_rposix.py
+++ b/rpython/rlib/test/test_rposix.py
@@ -281,6 +281,11 @@
def test_isatty(self):
assert rposix.isatty(-1) is False
+ def test_makedev(self):
+ dev = rposix.makedev(24, 7)
+ assert rposix.major(dev) == 24
+ assert rposix.minor(dev) == 7
+
@py.test.mark.skipif("not hasattr(os, 'ttyname')")
class TestOsExpect(ExpectTest):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit