@@ -343,8 +343,9 @@ def checkdep_dvipng():
343
343
try :
344
344
s = subprocess .Popen (['dvipng' ,'-version' ], stdout = subprocess .PIPE ,
345
345
stderr = subprocess .PIPE )
346
- line = s .stdout .readlines ()[1 ]
347
- v = line .split ()[- 1 ].decode ('ascii' )
346
+ stdout , stderr = s .communicate ()
347
+ line = stdout .decode ('ascii' ).split ('\n ' )[1 ]
348
+ v = line .split ()[- 1 ]
348
349
return v
349
350
except (IndexError , ValueError , OSError ):
350
351
return None
@@ -371,7 +372,8 @@ def checkdep_tex():
371
372
try :
372
373
s = subprocess .Popen (['tex' ,'-version' ], stdout = subprocess .PIPE ,
373
374
stderr = subprocess .PIPE )
374
- line = s .stdout .readlines ()[0 ].decode ('ascii' )
375
+ stdout , stderr = s .communicate ()
376
+ line = stdout .decode ('ascii' ).split ('\n ' )[0 ]
375
377
pattern = '3\.1\d+'
376
378
match = re .search (pattern , line )
377
379
v = match .group (0 )
@@ -383,9 +385,11 @@ def checkdep_pdftops():
383
385
try :
384
386
s = subprocess .Popen (['pdftops' ,'-v' ], stdout = subprocess .PIPE ,
385
387
stderr = subprocess .PIPE )
386
- for line in s .stderr :
387
- if b'version' in line :
388
- v = line .split ()[- 1 ].decode ('ascii' )
388
+ stdout , stderr = s .communicate ()
389
+ lines = stderr .decode ('ascii' ).split ('\n ' )
390
+ for line in lines :
391
+ if 'version' in line :
392
+ v = line .split ()[- 1 ]
389
393
return v
390
394
except (IndexError , ValueError , UnboundLocalError , OSError ):
391
395
return None
@@ -394,9 +398,11 @@ def checkdep_inkscape():
394
398
try :
395
399
s = subprocess .Popen (['inkscape' ,'-V' ], stdout = subprocess .PIPE ,
396
400
stderr = subprocess .PIPE )
397
- for line in s .stdout :
398
- if b'Inkscape' in line :
399
- v = line .split ()[1 ].decode ('ascii' )
401
+ stdout , stderr = s .communicate ()
402
+ lines = stdout .decode ('ascii' ).split ('\n ' )
403
+ for line in lines :
404
+ if 'Inkscape' in line :
405
+ v = line .split ()[1 ]
400
406
break
401
407
return v
402
408
except (IndexError , ValueError , UnboundLocalError , OSError ):
@@ -406,9 +412,11 @@ def checkdep_xmllint():
406
412
try :
407
413
s = subprocess .Popen (['xmllint' ,'--version' ], stdout = subprocess .PIPE ,
408
414
stderr = subprocess .PIPE )
409
- for line in s .stderr :
410
- if b'version' in line :
411
- v = line .split ()[- 1 ].decode ('ascii' )
415
+ stdout , stderr = s .communicate ()
416
+ lines = stderr .decode ('ascii' ).split ('\n ' )
417
+ for line in lines :
418
+ if 'version' in line :
419
+ v = line .split ()[- 1 ]
412
420
break
413
421
return v
414
422
except (IndexError , ValueError , UnboundLocalError , OSError ):
0 commit comments