use subprocess.run(..., text=True) instead of stdout.decode()
This commit is contained in:
parent
37cdd05cf5
commit
c2c525c35f
|
@ -94,7 +94,7 @@ class MenuCheck(AbstractCheck):
|
|||
directory = pkg.dir_name()
|
||||
for f in menus:
|
||||
# remove comments and handle cpp continuation lines
|
||||
text = subprocess.run(('/lib/cpp', directory + f), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=ENGLISH_ENVIROMENT).stdout.decode()
|
||||
text = subprocess.run(('/lib/cpp', directory + f), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=ENGLISH_ENVIROMENT, text=True).stdout
|
||||
if text.endswith('\n'):
|
||||
text = text[:-1]
|
||||
|
||||
|
|
|
@ -44,8 +44,9 @@ class MenuXDGCheck(AbstractFilesCheck):
|
|||
root = pkg.dir_name()
|
||||
f = root + filename
|
||||
try:
|
||||
command = subprocess.run(('desktop-file-validate', f), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=ENGLISH_ENVIROMENT)
|
||||
text = command.stdout.decode()
|
||||
command = subprocess.run(('desktop-file-validate', f), stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||
env=ENGLISH_ENVIROMENT, text=True)
|
||||
text = command.stdout
|
||||
if command.returncode:
|
||||
error_printed = False
|
||||
for line in text.splitlines():
|
||||
|
|
|
@ -489,8 +489,8 @@ class Pkg(AbstractPkg):
|
|||
def check_signature(self):
|
||||
ret = subprocess.run(('rpm', '-Kv', self.filename),
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||
env=ENGLISH_ENVIROMENT)
|
||||
text = ret.stdout.decode()
|
||||
env=ENGLISH_ENVIROMENT, text=True)
|
||||
text = ret.stdout
|
||||
if text.endswith('\n'):
|
||||
text = text[:-1]
|
||||
return ret.returncode, text
|
||||
|
|
Loading…
Reference in New Issue