mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue