Skip to content

Commit

Permalink
Some more Python 3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorak committed Jan 27, 2014
1 parent 2fcb979 commit 85a946e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion rpmquality/RpmQuality.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def performAll(self):
if not os.path.isdir(self._working_dir):
os.makedirs(self._working_dir, 0o755)

self._modules = dict(self._basic_modules.items() + self._extra_modules.items())
self._modules = self._basic_modules.copy()
self._modules.update(self._extra_modules.items())
for module_name in self._modules:
# where we want results (log), working directory, etc.
log_file = os.path.join(self._logs_location, "%s.log" % module_name)
Expand Down
6 changes: 4 additions & 2 deletions rpmquality/modules/RpmLint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import re
import subprocess
import DefaultModule
import locale

class RpmLint(DefaultModule.DefaultModule):
"""
Expand Down Expand Up @@ -48,8 +49,9 @@ def perform(self):
files_checked = 0
try:
print("Calling %s %s" % ("rpmlint", package))
out = subprocess.check_output(["rpmlint", package])

encoding = locale.getdefaultlocale()[1]
out = subprocess.check_output(["rpmlint", package]).decode(encoding)

except subprocess.CalledProcessError as e:
out = e.output

Expand Down

0 comments on commit 85a946e

Please sign in to comment.