Change maxstdio using ctypes as win32file module is not included with Python3 by default
This commit is contained in:
parent
d3e8fcea47
commit
6cffa1c0ca
1 changed files with 3 additions and 3 deletions
|
@ -5,11 +5,11 @@ import logging
|
|||
def setMaxfilesopened(limit):
|
||||
try:
|
||||
if sys.platform == "win32":
|
||||
import win32file
|
||||
maxstdio = win32file._getmaxstdio()
|
||||
import ctypes
|
||||
maxstdio = ctypes.cdll.msvcr100._getmaxstdio()
|
||||
if maxstdio < limit:
|
||||
logging.debug("Current maxstdio: %s, changing to %s..." % (maxstdio, limit))
|
||||
win32file._setmaxstdio(limit)
|
||||
ctypes.cdll.msvcr100._setmaxstdio(limit)
|
||||
return True
|
||||
else:
|
||||
import resource
|
||||
|
|
Loading…
Reference in a new issue