From 09f3fbe9b4a3e919c761cac3071f384bacdb4754 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 22 Nov 2017 12:13:13 +0200 Subject: [PATCH] Reorder/refactor for consistency --- PIL/ImageShow.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PIL/ImageShow.py b/PIL/ImageShow.py index 3f8732c56..bf8c67eb5 100644 --- a/PIL/ImageShow.py +++ b/PIL/ImageShow.py @@ -101,6 +101,7 @@ class Viewer(object): # -------------------------------------------------------------------- + if sys.platform == "win32": class WindowsViewer(Viewer): @@ -161,14 +162,15 @@ else: command = executable = "display" return command, executable + if which("display"): + register(DisplayViewer) + class EogViewer(UnixViewer): def get_command_ex(self, file, **options): command = executable = "eog" return command, executable - if which("display"): - register(DisplayViewer) - elif which("eog"): + if which("eog"): register(EogViewer) class XVViewer(UnixViewer):