Skip to content

Commit d016bd8

Browse files
author
Douglas Lassance
committed
Move shell keyword argument on class initialization
This will define the shell behavior for all instantiated contexts.
1 parent 02290ce commit d016bd8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

exiftool.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,15 @@ class ExifTool(object):
148148
associated with a running subprocess.
149149
"""
150150

151-
def __init__(self, executable_=None):
151+
def __init__(self, executable_=None, shell=True):
152+
self.shell = shell
152153
if executable_ is None:
153154
self.executable = executable
154155
else:
155156
self.executable = executable_
156157
self.running = False
157158

158-
def start(self, shell=True):
159+
def start(self):
159160
"""Start an ``exiftool`` process in batch mode for this instance.
160161
161162
This method will issue a ``UserWarning`` if the subprocess is
@@ -168,7 +169,7 @@ def start(self, shell=True):
168169
return
169170
with open(os.devnull, "w") as devnull:
170171
startupInfo = subprocess.STARTUPINFO()
171-
if not shell:
172+
if not self.shell:
172173
# Adding enum 11 (SW_FORCEMINIMIZE in win32api speak) will
173174
# keep it from throwing up a DOS shell when it launches.
174175
startupInfo.dwFlags |= 11

0 commit comments

Comments
 (0)