equal
deleted
inserted
replaced
8 |
8 |
9 import binascii |
9 import binascii |
10 |
10 |
11 # This ugly style has a noticeable effect in manifest parsing |
11 # This ugly style has a noticeable effect in manifest parsing |
12 hex = binascii.hexlify |
12 hex = binascii.hexlify |
13 # Adapt to Python 3 API changes. If this ends up showing up in |
13 bin = binascii.unhexlify |
14 # profiles, we can use this version only on Python 3, and forward |
|
15 # binascii.unhexlify like we used to on Python 2. |
|
16 def bin(s): |
|
17 try: |
|
18 return binascii.unhexlify(s) |
|
19 except binascii.Error as e: |
|
20 raise TypeError(e) |
|
21 |
14 |
22 |
15 |
23 def short(node): |
16 def short(node): |
24 return hex(node[:6]) |
17 return hex(node[:6]) |
25 |
18 |