Commits

Armin Rigo  committed 6354cd3

os.makedev().

  • Participants
  • Parent commits 2467ae1

Comments (0)

Files changed (3)

File pypy/module/posix/__init__.py

         interpleveldefs['ttyname'] = 'interp_posix.ttyname'
     if hasattr(os, 'getloadavg'):
         interpleveldefs['getloadavg'] = 'interp_posix.getloadavg'
+    if hasattr(os, 'makedev'):
+        interpleveldefs['makedev'] = 'interp_posix.makedev'
     if hasattr(os, 'major'):
         interpleveldefs['major'] = 'interp_posix.major'
     if hasattr(os, 'minor'):

File pypy/module/posix/interp_posix.py

                            space.wrap(load[2])])
 getloadavg.unwrap_spec = [ObjSpace]
 
+def makedev(space, major, minor):
+    result = os.makedev(major, minor)
+    return space.wrap(result)
+makedev.unwrap_spec = [ObjSpace, 'c_int', 'c_int']
+
 def major(space, device):
     result = os.major(device)
     return space.wrap(result)

File pypy/module/posix/test/test_posix2.py

             os = self.posix
             assert os.major(12345) == self.expected_major_12345
             assert os.minor(12345) == self.expected_minor_12345
+            assert os.makedev(self.expected_major_12345,
+                              self.expected_minor_12345) == 12345
 
     if hasattr(os, 'fsync'):
         def test_fsync(self):