Skip to content

Commit

Permalink
Do not pass None to subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 14, 2022
1 parent 6faebd3 commit f3b7ee2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/PIL/ImageShow.py
Expand Up @@ -270,8 +270,9 @@ def show_file(self, path=None, **options):
else:
raise TypeError("Missing required argument: 'path'")
args = ["display"]
if "title" in options:
args += ["-title", options["title"]]
title = options.get("title")
if title:
args += ["-title", title]
args.append(path)

subprocess.Popen(args)
Expand Down Expand Up @@ -368,8 +369,9 @@ def show_file(self, path=None, **options):
else:
raise TypeError("Missing required argument: 'path'")
args = ["xv"]
if "title" in options:
args += ["-name", options["title"]]
title = options.get("title")
if title:
args += ["-name", title]
args.append(path)

subprocess.Popen(args)
Expand Down

0 comments on commit f3b7ee2

Please sign in to comment.