Skip to content

Compare bytes/str correctly in both python 2 & 3

Heewa Barfchin requested to merge heewa.b/jhbuild:fix-str-bytes into master

Fixes 2 errors thrown when running with: jhbuild build -D '...' <pkg>:

...
  File "/home/heewa/.local/lib/python3.8/site-packages/jhbuild/versioncontrol/git.py", line 372, in _get_commit_from_date
    if line.startswith('commit '):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

(and if that's fixed:)

...
  File "/home/heewa/.local/lib/python3.8/site-packages/jhbuild/frontends/terminal.py", line 190, in execute
    print_args['command'] = ' '.join(command)
TypeError: sequence item 3: expected str instance, bytes found

This change should work for both python 2 & 3.

Merge request reports