File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
try :
2
- import binascii
2
+ from binascii import hexlify
3
3
except ImportError :
4
4
print ("SKIP" )
5
5
raise SystemExit
10
10
b"\x7f \x80 \xff " ,
11
11
b"1234ABCDabcd" ,
12
12
):
13
- print (binascii . hexlify (x ))
13
+ print (hexlify (x ))
14
14
15
15
# Two-argument version (now supported in CPython)
16
- print (binascii . hexlify (b"123" , ":" ))
16
+ print (hexlify (b"123" , ":" ))
17
17
18
18
# zero length buffer
19
- print (binascii . hexlify (b"" , b":" ))
19
+ print (hexlify (b"" , b":" ))
Original file line number Diff line number Diff line change 1
1
try :
2
- import binascii
2
+ from binascii import unhexlify
3
3
except ImportError :
4
4
print ("SKIP" )
5
5
raise SystemExit
10
10
b"7f80ff" ,
11
11
b"313233344142434461626364" ,
12
12
):
13
- print (binascii . unhexlify (x ))
13
+ print (unhexlify (x ))
14
14
15
15
try :
16
- a = binascii . unhexlify (b"0" ) # odd buffer length
16
+ a = unhexlify (b"0" ) # odd buffer length
17
17
except ValueError :
18
18
print ("ValueError" )
19
19
20
20
try :
21
- a = binascii . unhexlify (b"gg" ) # digit not hex
21
+ a = unhexlify (b"gg" ) # digit not hex
22
22
except ValueError :
23
23
print ("ValueError" )
You can’t perform that action at this time.
0 commit comments