@@ -386,9 +386,10 @@ def checkdep_pdftops():
386
386
s = subprocess .Popen (['pdftops' ,'-v' ], stdout = subprocess .PIPE ,
387
387
stderr = subprocess .PIPE )
388
388
stdout , stderr = s .communicate ()
389
- if b'version' in stderr :
390
- line = stderr .decode ('ascii' ).split ('\n ' )[0 ]
391
- v = line .split ()[- 1 ]
389
+ lines = stderr .decode ('ascii' ).split ('\n ' )
390
+ for line in lines :
391
+ if 'version' in line :
392
+ v = line .split ()[- 1 ]
392
393
return v
393
394
except (IndexError , ValueError , UnboundLocalError , OSError ):
394
395
return None
@@ -398,8 +399,10 @@ def checkdep_inkscape():
398
399
s = subprocess .Popen (['inkscape' ,'-V' ], stdout = subprocess .PIPE ,
399
400
stderr = subprocess .PIPE )
400
401
stdout , stderr = s .communicate ()
401
- if b'Inkscape' in stdout :
402
- v = stdout .split ()[1 ].decode ('ascii' )
402
+ lines = stdout .decode ('ascii' ).split ('\n ' )
403
+ for line in lines :
404
+ if 'Inkscape' in line :
405
+ v = line .split ()[1 ]
403
406
return v
404
407
except (IndexError , ValueError , UnboundLocalError , OSError ):
405
408
return None
@@ -409,9 +412,10 @@ def checkdep_xmllint():
409
412
s = subprocess .Popen (['xmllint' ,'--version' ], stdout = subprocess .PIPE ,
410
413
stderr = subprocess .PIPE )
411
414
stdout , stderr = s .communicate ()
412
- if b'version' in stderr :
413
- line = stderr .decode ('ascii' ).split ('\n ' )[0 ]
414
- v = line .split ()[- 1 ]
415
+ lines = stderr .decode ('ascii' ).split ('\n ' )
416
+ for line in lines :
417
+ if 'version' in line :
418
+ v = line .split ()[- 1 ]
415
419
return v
416
420
except (IndexError , ValueError , UnboundLocalError , OSError ):
417
421
return None
0 commit comments