Skip to content

Commit 3abcf83

Browse files
committed
fall back to running -version if -V fails to return a result
1 parent d791d1d commit 3abcf83

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

funannotate/check.py

+4
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ def check_version7(name):
274274
vers = subprocess.Popen([name, '-V'], stderr=subprocess.PIPE,
275275
stdout=subprocess.PIPE, universal_newlines=True).communicate()[0].strip()
276276
vers = vers.split(' ')[-1]
277+
if not vers:
278+
vers = subprocess.Popen([name, '-version'], stderr=subprocess.PIPE,
279+
stdout=subprocess.PIPE, universal_newlines=True).communicate()[0].strip()
280+
vers = vers.split(' ')[2]
277281
except OSError as e:
278282
if e.errno == errno.ENOENT:
279283
return False

0 commit comments

Comments
 (0)