/[base]
ViewVC logotype

Revision 347996


Jump to revision: Previous Next
Author: ngie
Date: Mon May 20 16:38:12 2019 UTC (5 years, 1 month ago)
Changed paths: 2
Log Message:
Replace uses of `foo.(de|en)code('hex')` with `binascii.(un)?hexlify(foo)`

Python 3 no longer doesn't support encoding/decoding hexadecimal numbers using
the `str.format` method. The backwards compatible new method (using the
binascii module/methods) is a comparable means of converting to/from
hexadecimal format.

In short, the functional change is the following:
* `foo.decode('hex')` -> `binascii.unhexlify(foo)`
* `foo.encode('hex')` -> `binascii.hexlify(foo)`

While here, move the dpkt import in `cryptodev.py` down per PEP8, so it comes
after the standard library provided imports.

PR:		237403
MFC after:	1 week


Changed paths

Path Details
Directoryhead/tests/sys/opencrypto/cryptodev.py modified , text changed
Directoryhead/tests/sys/opencrypto/cryptotest.py modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27