Mercurial > hg
comparison mercurial/cext/osutil.c @ 48814:41bd7e8fc82e
cext: remove Python 2 variant of listdir_slot()
Differential Revision: https://phab.mercurial-scm.org/D12225
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 15:45:16 -0700 |
parents | ed03fffaac30 |
children | e9ca736f5b52 |
comparison
equal
deleted
inserted
replaced
48813:be3af7eb2bbb | 48814:41bd7e8fc82e |
---|---|
71 PyObject_HEAD | 71 PyObject_HEAD |
72 struct stat st; | 72 struct stat st; |
73 }; | 73 }; |
74 #endif | 74 #endif |
75 | 75 |
76 #ifdef IS_PY3K | |
77 #define listdir_slot(name) \ | 76 #define listdir_slot(name) \ |
78 static PyObject *listdir_stat_##name(PyObject *self, void *x) \ | 77 static PyObject *listdir_stat_##name(PyObject *self, void *x) \ |
79 { \ | 78 { \ |
80 return PyLong_FromLong(((struct listdir_stat *)self)->st.name); \ | 79 return PyLong_FromLong(((struct listdir_stat *)self)->st.name); \ |
81 } | 80 } |
82 #else | |
83 #define listdir_slot(name) \ | |
84 static PyObject *listdir_stat_##name(PyObject *self, void *x) \ | |
85 { \ | |
86 return PyInt_FromLong(((struct listdir_stat *)self)->st.name); \ | |
87 } | |
88 #endif | |
89 | 81 |
90 listdir_slot(st_dev) | 82 listdir_slot(st_dev) |
91 listdir_slot(st_mode) | 83 listdir_slot(st_mode) |
92 listdir_slot(st_nlink) | 84 listdir_slot(st_nlink) |
93 #ifdef _WIN32 | 85 #ifdef _WIN32 |