Skip to content

Commit

Permalink
Another try for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiisoup committed Nov 11, 2024
1 parent 67eb1a3 commit 038a1a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testings/test_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
def assert_file_not_in_use(filename):
platform = sys.platform
if platform == "linux":
from subprocess import check_output,Popen, PIPE

lsout = Popen(['lsof',filename],stdout=PIPE, shell=False)
check_output(["grep",filename], stdin=lsout.stdout, shell=False)

for proc in psutil.process_iter():
try:
for item in proc.open_files():
Expand Down

0 comments on commit 038a1a1

Please sign in to comment.