Skip to content

Commit

Permalink
Merge pull request #66 from EthanArbuckle/fix-resource-limits
Browse files Browse the repository at this point in the history
Fix TypeError in resource limits handling
  • Loading branch information
arandomdev authored Jan 27, 2025
2 parents 54c6540 + 2c8e902 commit 0e1b35a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions bin/dyldex
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import sys
from typing import List, BinaryIO

try:
import resource
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, resource.getrlimit(resource.RLIMIT_NOFILE)))
import resource
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, hard))
except ImportError:
# resource module is not avilable on windows
pass
# resource module is not available on windows
pass

try:
progressbar.streams
Expand Down
9 changes: 5 additions & 4 deletions bin/dyldex_all
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import sys
import progressbar

try:
import resource
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, resource.getrlimit(resource.RLIMIT_NOFILE)))
import resource
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (1024, hard))
except ImportError:
# resource module is not avilable on windows
pass
# resource module is not available on windows
pass

from typing import (
List,
Expand Down

0 comments on commit 0e1b35a

Please sign in to comment.