================
@@ -602,18 +602,28 @@ def executeBuiltinUlimit(cmd, shenv):
"""executeBuiltinUlimit - Change the current limits."""
if os.name != "posix":
raise InternalShellError(cmd, "'ulimit' not supported on this system")
+ # Import resource here after we confirm we are on a POSIX system as the
+ # module does not exist on Windows.
+ import resource
----------------
ilovepi wrote:
I could go either way on this import here. on one hand I like that its
conditional, since ulimit is rare. on the other hand, I'd generally prefer the
imports be together at the top of the file.
https://github.com/llvm/llvm-project/pull/165123
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits