Skip to content

Commit acd102e

Browse files
Only test NODEV on Linux.
1 parent 17c02dc commit acd102e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Lib/test/test_posix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,8 @@ def test_makedev(self):
724724
self.assertRaises((ValueError, OverflowError), posix.makedev, x, minor)
725725
self.assertRaises((ValueError, OverflowError), posix.makedev, major, x)
726726

727-
if hasattr(posix, '_NODEV'):
728-
NODEV = posix._NODEV
727+
if sys.platform == 'linux':
728+
NODEV = -1
729729
self.assertEqual(posix.major(NODEV), NODEV)
730730
self.assertEqual(posix.minor(NODEV), NODEV)
731731

Modules/posixmodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17034,10 +17034,6 @@ all_ins(PyObject *m)
1703417034
if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR", LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)) return -1;
1703517035
#endif
1703617036

17037-
#ifdef NODEV
17038-
if (PyModule_AddIntConstant(m, "_NODEV", NODEV)) return -1;
17039-
#endif
17040-
1704117037
return 0;
1704217038
}
1704317039

0 commit comments

Comments
 (0)