Author: Joannah Nanjekye <[email protected]>
Branch: get/setpriority
Changeset: r90378:56478fb6d837
Date: 2016-12-28 02:15 +0300
http://bitbucket.org/pypy/pypy/changeset/56478fb6d837/
Log: registering attributes
diff --git a/pypy/module/posix/__init__.py b/pypy/module/posix/__init__.py
--- a/pypy/module/posix/__init__.py
+++ b/pypy/module/posix/__init__.py
@@ -81,6 +81,8 @@
'scandir': 'interp_scandir.scandir',
'get_inheritable': 'interp_posix.get_inheritable',
'set_inheritable': 'interp_posix.set_inheritable',
+ 'getpriority': 'interp_posix.getpriority',
+ 'setpriority': 'interp_posix.setpriority',
}
if hasattr(os, 'chown'):
@@ -169,8 +171,7 @@
'setpgrp', 'getppid', 'getpgid', 'setpgid', 'setreuid',
'setregid', 'getsid', 'setsid', 'fstatvfs', 'statvfs',
'setgroups', 'initgroups', 'tcgetpgrp', 'tcsetpgrp',
- 'getresuid', 'getresgid', 'setresuid', 'setresgid',
- 'getpriority', 'setpriority']:
+ 'getresuid', 'getresgid', 'setresuid', 'setresgid',]:
if hasattr(os, name):
interpleveldefs[name] = 'interp_posix.%s' % (name,)
# not visible via os, inconsistency in nt:
diff --git a/pypy/module/posix/test/test_posix2.py
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -855,10 +855,10 @@
assert os.getpriority(os.PRIO_PROCESS, os.getpid()) ==
posix.getpriority(os.PRIO_PROCESS, os.getpid())
def test_os_setpriority(self):
- os = self.posix
- result = os.getpriority(os.PRIO_PROCESS, os.getpid())
- os.setpriority(os.PRIO_PROCESS, os.getpid(), result + 1)
- new_result = os.getpriority(os.PRIO_PROCESS, os.getpid())
+ posix, os = self.posix, self.os
+ result = posix.getpriority(os.PRIO_PROCESS, os.getpid())
+ posix.setpriority(os.PRIO_PROCESS, os.getpid(), result + 1)
+ new_result = posix.getpriority(os.PRIO_PROCESS, os.getpid())
assert new_result == (result + 1)
def test_write_buffer(self):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit