Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jbrowse: finish python3 conversion #1076

Merged
merged 2 commits into from
Dec 14, 2016
Merged

Conversation

abretaud
Copy link
Contributor

Some code that needed to be ported to python3 (just converted as explained in http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back)

@bgruening
Copy link
Member

One test is failing.
@abretaud maybe you should pin a specific python version to be safe?

@@ -127,7 +127,7 @@ def __init__(self):

def rgb_from_hex(self, hexstr):
# http://stackoverflow.com/questions/4296249/how-do-i-convert-a-hex-triplet-to-an-rgb-tuple-and-back
return struct.unpack('BBB', hexstr.decode('hex'))
return struct.unpack('BBB', bytes.fromhex(hexstr))
Copy link
Member

@nsoranzo nsoranzo Dec 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that

        return struct.unpack('BBB', codecs.decode(hexstr, 'hex'))

should work for both Python 2 and 3.

Obviously you need to import codecs at the top.

@abretaud
Copy link
Contributor Author

Thanks @nsoranzo! it should be ok now

@nsoranzo nsoranzo merged commit 172014e into galaxyproject:master Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants