Skip to content

Commit

Permalink
Use subprocess with CREATE_NO_WINDOW flag in WindowsViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 10, 2024
1 parent 6782a07 commit 373c62e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/PIL/ImageShow.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ def get_command(self, file: str, **options: Any) -> str:
f'&& del /f "{file}"'
)

def show_file(self, path: str, **options: Any) -> int:
"""
Display given file.
"""
subprocess.Popen(

Check warning on line 145 in src/PIL/ImageShow.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/ImageShow.py#L145

Added line #L145 was not covered by tests
self.get_command(path, **options),
shell=True,
creationflags=getattr(subprocess, "CREATE_NO_WINDOW"),
) # nosec
return 1

Check warning on line 150 in src/PIL/ImageShow.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/ImageShow.py#L150

Added line #L150 was not covered by tests


if sys.platform == "win32":
register(WindowsViewer)
Expand Down

0 comments on commit 373c62e

Please sign in to comment.