@@ -343,8 +343,9 @@ def checkdep_dvipng():
343343 try :
344344 s = subprocess .Popen (['dvipng' ,'-version' ], stdout = subprocess .PIPE ,
345345 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 ]
348349 return v
349350 except (IndexError , ValueError , OSError ):
350351 return None
@@ -371,7 +372,8 @@ def checkdep_tex():
371372 try :
372373 s = subprocess .Popen (['tex' ,'-version' ], stdout = subprocess .PIPE ,
373374 stderr = subprocess .PIPE )
374- line = s .stdout .readlines ()[0 ].decode ('ascii' )
375+ stdout , stderr = s .communicate ()
376+ line = stdout .decode ('ascii' ).split ('\n ' )[0 ]
375377 pattern = '3\.1\d+'
376378 match = re .search (pattern , line )
377379 v = match .group (0 )
@@ -383,9 +385,11 @@ def checkdep_pdftops():
383385 try :
384386 s = subprocess .Popen (['pdftops' ,'-v' ], stdout = subprocess .PIPE ,
385387 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 ]
389393 return v
390394 except (IndexError , ValueError , UnboundLocalError , OSError ):
391395 return None
@@ -394,9 +398,11 @@ def checkdep_inkscape():
394398 try :
395399 s = subprocess .Popen (['inkscape' ,'-V' ], stdout = subprocess .PIPE ,
396400 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 ]
400406 break
401407 return v
402408 except (IndexError , ValueError , UnboundLocalError , OSError ):
@@ -406,9 +412,11 @@ def checkdep_xmllint():
406412 try :
407413 s = subprocess .Popen (['xmllint' ,'--version' ], stdout = subprocess .PIPE ,
408414 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 ]
412420 break
413421 return v
414422 except (IndexError , ValueError , UnboundLocalError , OSError ):
0 commit comments