Fix ResourceWarning in openFolder() on Windows
subprocess.Popen emits ResourceWarning in the destructor if the status of the process was not read. Fix by using subprocess.run() instead, which takes care of that. Using run() is also recommended for simple cases like this in the docs.
This commit is contained in:
parent
0d49b3eabb
commit
47e80da1f8
@ -688,7 +688,7 @@ def mungeQA(col: Collection, txt: str) -> str:
|
||||
|
||||
def openFolder(path: str) -> None:
|
||||
if isWin:
|
||||
subprocess.Popen(["explorer", f"file://{path}"])
|
||||
subprocess.run(["explorer", f"file://{path}"], check=False)
|
||||
else:
|
||||
with noBundledLibs():
|
||||
QDesktopServices.openUrl(QUrl(f"file://{path}"))
|
||||
|
Loading…
Reference in New Issue
Block a user