Skip to content

Commit

Permalink
rm maxpath / maxfile from Windows C code
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Apr 17, 2024
1 parent a7fec1b commit 402bfbf
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions psutil/arch/windows/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,11 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
strcat_s(mp_path, _countof(mp_path), mp_buf);

py_tuple = Py_BuildValue(
"(ssssIi)",
"(ssss)",
drive_letter,
mp_path,
fs_type, // typically "NTFS"
opts,
lpMaximumComponentLength, // max file length
MAX_PATH // max path length
opts
);

if (!py_tuple ||
Expand All @@ -350,13 +348,11 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
strcat_s(opts, _countof(opts), psutil_get_drive_type(type));

py_tuple = Py_BuildValue(
"(ssssIi)",
"(ssss)",
drive_letter,
drive_letter,
fs_type, // either FAT, FAT32, NTFS, HPFS, CDFS, UDF or NWFS
opts,
lpMaximumComponentLength, // max file length
MAX_PATH // max path length
opts
);
if (!py_tuple)
goto error;
Expand Down

0 comments on commit 402bfbf

Please sign in to comment.