[jhbuild/wip/sam/python3] Fix more stuff
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild/wip/sam/python3] Fix more stuff
- Date: Wed, 27 Jan 2016 14:18:11 +0000 (UTC)
commit ba28bbb6a2f728bcf3a4ef97ce08d91aac191d7c
Author: Sam Thursfield <sam thursfield codethink co uk>
Date: Wed Jan 27 13:06:33 2016 +0100
Fix more stuff
jhbuild/frontends/terminal.py | 2 +-
jhbuild/main.py | 5 +----
jhbuild/modtypes/__init__.py | 2 +-
jhbuild/utils/cmds.py | 10 +++++-----
jhbuild/versioncontrol/git.py | 2 +-
tests/mock.py | 3 +++
tests/tests.py | 2 +-
7 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/jhbuild/frontends/terminal.py b/jhbuild/frontends/terminal.py
index 97061f7..da5522b 100644
--- a/jhbuild/frontends/terminal.py
+++ b/jhbuild/frontends/terminal.py
@@ -102,7 +102,7 @@ class TerminalBuildScript(buildscript.BuildScript):
self.display_status_line(progress_percent, module_num, msg)
if is_xterm:
- sys.stdout.write('\033]0;jhbuild:%s%s\007' % (uencode(msg), progress))
+ sys.stdout.write('\033]0;jhbuild:%s%s\007' % (msg, progress))
sys.stdout.flush()
self.trayicon.set_tooltip('%s%s' % (msg, progress))
diff --git a/jhbuild/main.py b/jhbuild/main.py
index 853a9ee..b1f8cbd 100644
--- a/jhbuild/main.py
+++ b/jhbuild/main.py
@@ -65,10 +65,7 @@ def udecode(s):
def uprint(*args):
'''Print Unicode string encoded for the terminal'''
- for s in args[:-1]:
- print(uencode(s), end=' ')
- s = args[-1]
- print(uencode(s))
+ print(''.join(*args))
builtins.__dict__['uprint'] = uprint
builtins.__dict__['uencode'] = uencode
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index c5be891..df3e5e9 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -451,7 +451,7 @@ them into the prefix."""
install_date = buildscript.moduleset.packagedb.installdate(self.name)
for dep in self.dependencies:
install_date_dep = buildscript.moduleset.packagedb.installdate(dep)
- if install_date_dep > install_date:
+ if install_date_dep and install_date_dep > install_date:
# a dependency has been updated
return None
else:
diff --git a/jhbuild/utils/cmds.py b/jhbuild/utils/cmds.py
index cb49021..2965a6c 100644
--- a/jhbuild/utils/cmds.py
+++ b/jhbuild/utils/cmds.py
@@ -64,7 +64,7 @@ def get_output(cmd, cwd=None, extra_env=None, get_stderr = True):
stdout, stderr = p.communicate()
if p.returncode != 0:
raise CommandError(_('Error running %s') % cmd, p.returncode)
- return stdout
+ return stdout.decode('unicode-escape')
class Pipeline(subprocess.Popen):
'''A class that wraps a sequence of subprocess.Popen() objects
@@ -188,7 +188,7 @@ def pprint_output(pipe, format_line):
read_set.remove(pipe.stdout)
if sys.stdin in read_set:
read_set.remove(sys.stdin)
- out_data += out_chunk
+ out_data += out_chunk.decode('unicode-escape')
while '\n' in out_data:
pos = out_data.find('\n')
format_line(out_data[:pos+1], False)
@@ -199,7 +199,7 @@ def pprint_output(pipe, format_line):
if err_chunk == '':
pipe.stderr.close()
read_set.remove(pipe.stderr)
- err_data += err_chunk
+ err_data += err_chunk.decode('unicode-escape')
while '\n' in err_data:
pos = err_data.find('\n')
format_line(err_data[:pos+1], True)
@@ -243,14 +243,14 @@ def compare_version(version, minver):
for i, ver in enumerate(version):
part = re.sub(r'^[^\d]*(\d*).*$', r'\1', ver)
if not part:
- version[i] = None
+ version[i] = 0
else:
version[i] = int(part)
minver = minver.split('.')
for i, ver in enumerate(minver):
part = re.sub(r'^[^\d]*(\d*).*$', r'\1', ver)
if not part:
- minver[i] = None
+ minver[i] = 0
else:
minver[i] = int(part)
return version >= minver
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index 628c2dd..37fe2b0 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -360,7 +360,7 @@ class GitBranch(Branch):
stdout = proc.communicate()[0]
if not stdout.strip():
raise CommandError(_('Command %s returned no output') % cmd_desc)
- for line in stdout.splitlines():
+ for line in stdout.decode('unicode-escape').splitlines():
if line.startswith('commit '):
commit = line.split(None, 1)[1].strip()
return commit
diff --git a/tests/mock.py b/tests/mock.py
index e707b5c..40af9f9 100644
--- a/tests/mock.py
+++ b/tests/mock.py
@@ -56,6 +56,9 @@ class Config(jhbuild.config.Config):
makeargs = ''
module_makeargs = {}
build_targets = ['install']
+ exit_on_error = False
+ disable_Werror = False
+ jobs = 1
min_age = None
diff --git a/tests/tests.py b/tests/tests.py
index 83e28c6..801d8ad 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -636,7 +636,7 @@ class EndToEndTest(JhbuildConfigTestCase):
with_stdout_hidden(build.build)
proc = subprocess.Popen(['hello'], stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
- self.assertEquals(stdout.strip(), 'Hello world (autotools)')
+ self.assertEquals(stdout.strip(), b'Hello world (autotools)')
self.assertEquals(proc.wait(), 0)
# Won't pass under stock MSYS because pkgconfig isn't installed in base
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]