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):
|
def setMaxfilesopened(limit):
|
||||||
try:
|
try:
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
import win32file
|
import ctypes
|
||||||
maxstdio = win32file._getmaxstdio()
|
maxstdio = ctypes.cdll.msvcr100._getmaxstdio()
|
||||||
if maxstdio < limit:
|
if maxstdio < limit:
|
||||||
logging.debug("Current maxstdio: %s, changing to %s..." % (maxstdio, limit))
|
logging.debug("Current maxstdio: %s, changing to %s..." % (maxstdio, limit))
|
||||||
win32file._setmaxstdio(limit)
|
ctypes.cdll.msvcr100._setmaxstdio(limit)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
import resource
|
import resource
|
||||||
|
|
Loading…
Reference in a new issue