Skip to content

Commit 0e1b35a

Browse files
authored
Merge pull request arandomdev#66 from EthanArbuckle/fix-resource-limits
Fix TypeError in resource limits handling
2 parents 54c6540 + 2c8e902 commit 0e1b35a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

bin/dyldex

100644100755
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import sys
99
from typing import List, BinaryIO
1010

1111
try:
12-
import resource
13-
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, resource.getrlimit(resource.RLIMIT_NOFILE)))
12+
import resource
13+
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
14+
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, hard))
1415
except ImportError:
15-
# resource module is not avilable on windows
16-
pass
16+
# resource module is not available on windows
17+
pass
1718

1819
try:
1920
progressbar.streams

bin/dyldex_all

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import sys
1111
import progressbar
1212

1313
try:
14-
import resource
15-
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, resource.getrlimit(resource.RLIMIT_NOFILE)))
14+
import resource
15+
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
16+
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, hard))
1617
except ImportError:
17-
# resource module is not avilable on windows
18-
pass
18+
# resource module is not available on windows
19+
pass
1920

2021
from typing import (
2122
List,

0 commit comments

Comments
 (0)