From 54411d45f73b136901a7dc50e6db8bdfea6307fc Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 9 Nov 2021 20:14:35 +0300 Subject: [PATCH] bpo-45767: consume dev_t with PyLong_FromUnsignedLongLong (GH-29494) --- .../next/Library/2022-01-20-14-31-05.bpo-45767.ksJ8Ev.rst | 2 ++ Modules/posixmodule.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2022-01-20-14-31-05.bpo-45767.ksJ8Ev.rst diff --git a/Misc/NEWS.d/next/Library/2022-01-20-14-31-05.bpo-45767.ksJ8Ev.rst b/Misc/NEWS.d/next/Library/2022-01-20-14-31-05.bpo-45767.ksJ8Ev.rst new file mode 100644 index 00000000000000..9e29e4135e46fe --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-20-14-31-05.bpo-45767.ksJ8Ev.rst @@ -0,0 +1,2 @@ +Make ``_PyLong_FromDev`` treat ``dev_t`` as ``unsigned long +long`` instead of ``long long``. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7b5c3ef575565c..9440df46892ded 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -878,7 +878,7 @@ _Py_Gid_Converter(PyObject *obj, gid_t *p) #endif /* MS_WINDOWS */ -#define _PyLong_FromDev PyLong_FromLongLong +#define _PyLong_FromDev PyLong_FromUnsignedLongLong #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)