2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Check for buffer and use memoryview if missing

Python 3 does not implement buffer.  Use memoryview
as a standin if buffer would induce a NameError.

Change-Id: Id36e8253fffee9dc22bd982e00554f1c25bc95b4
This commit is contained in:
Jarrod Johnson 2016-10-11 11:00:59 -04:00
parent aee3ae36b0
commit dad54d5db5
4 changed files with 16 additions and 0 deletions

View File

@ -33,6 +33,10 @@ try:
xrange
except NameError:
xrange = range
try:
buffer
except NameError:
buffer = memoryview
boot_devices = {

View File

@ -26,6 +26,10 @@ try:
xrange
except NameError:
xrange = range
try:
buffer
except NameError:
buffer = memoryview
psucfg_errors = {

View File

@ -48,6 +48,10 @@ try:
xrange
except NameError:
xrange = range
try:
buffer
except NameError:
buffer = memoryview
inventory.register_inventory_category(cpu)
inventory.register_inventory_category(dimm)

View File

@ -21,6 +21,10 @@ try:
xrange
except NameError:
xrange = range
try:
buffer
except NameError:
buffer = memoryview
def decode_wireformat_uuid(rawguid):