Skip to content

Commit 435802e

Browse files
committed
Use sys.platform check for resouces import to satisfy mypy
1 parent db62603 commit 435802e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/adf_core_python/launcher.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import argparse
2+
import sys
23

3-
try:
4+
if sys.platform != "win32"
45
import resource
5-
except ImportError:
6-
resource = None
76

87
from adf_core_python.core.config.config import Config
98
from adf_core_python.core.launcher.agent_launcher import AgentLauncher
@@ -16,7 +15,7 @@ def __init__(
1615
self,
1716
launcher_config_file: str,
1817
) -> None:
19-
if resource is not None:
18+
if sys.platform != "win32":
2019
try:
2120
resource.setrlimit(resource.RLIMIT_NOFILE, (8192, 1048576))
2221
except Exception as e:

0 commit comments

Comments
 (0)