This repository was archived by the owner on Dec 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,13 @@ import logging
77import os
88import sys
99from typing import List , BinaryIO
10- import resource
10+
11+ try :
12+ import resource
13+ resource .setrlimit (resource .RLIMIT_NOFILE , (1024 , resource .getrlimit (resource .RLIMIT_NOFILE )))
14+ except ImportError :
15+ # resource module is not avilable on windows
16+ pass
1117
1218try :
1319 progressbar .streams
@@ -102,8 +108,6 @@ def _extractImage(
102108 """
103109
104110 logger = logging .getLogger ()
105-
106- resource .setrlimit (resource .RLIMIT_NOFILE , (1024 , resource .getrlimit (resource .RLIMIT_NOFILE )[1 ]))
107111
108112 statusBar = progressbar .ProgressBar (
109113 prefix = "{variables.unit} >> {variables.status} :: [" ,
Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ import pathlib
99import signal
1010import sys
1111import progressbar
12- import resource
12+
13+ try :
14+ import resource
15+ resource .setrlimit (resource .RLIMIT_NOFILE , (1024 , resource .getrlimit (resource .RLIMIT_NOFILE )))
16+ except ImportError :
17+ # resource module is not avilable on windows
18+ pass
1319
1420from typing import (
1521 List ,
@@ -117,8 +123,6 @@ def _extractImage(
117123 # setup logging
118124 logger = logging .getLogger (f"Worker: { outputPath } " )
119125
120- resource .setrlimit (resource .RLIMIT_NOFILE , (1024 , resource .getrlimit (resource .RLIMIT_NOFILE )[1 ]))
121-
122126 loggingStream = io .StringIO ()
123127 handler = logging .StreamHandler (loggingStream )
124128 formatter = logging .Formatter (
You can’t perform that action at this time.
0 commit comments