Skip to content

Commit 4d28b2a

Browse files
Update core/libs/commonwealth/commonwealth/utils/general.py
Co-authored-by: João Antônio Cardoso <[email protected]>
1 parent adf130d commit 4d28b2a

File tree

1 file changed

+2
-1
lines changed
  • core/libs/commonwealth/commonwealth/utils

1 file changed

+2
-1
lines changed

core/libs/commonwealth/commonwealth/utils/general.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ def delete_everything(path: Path) -> None:
3838

3939
def file_is_open(path: Path) -> bool:
4040
try:
41+
kernel_functions_timeout = str(2)
4142
result = subprocess.run(
42-
["lsof", path.resolve()], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, timeout=5
43+
["lsof", "-t", "-n", "-P", "-S", kernel_functions_timeout, path.resolve()], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False, timeout=5
4344
)
4445
return result.returncode == 0
4546
except Exception as error:

0 commit comments

Comments
 (0)