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:
parent
aee3ae36b0
commit
dad54d5db5
@ -33,6 +33,10 @@ try:
|
||||
xrange
|
||||
except NameError:
|
||||
xrange = range
|
||||
try:
|
||||
buffer
|
||||
except NameError:
|
||||
buffer = memoryview
|
||||
|
||||
|
||||
boot_devices = {
|
||||
|
@ -26,6 +26,10 @@ try:
|
||||
xrange
|
||||
except NameError:
|
||||
xrange = range
|
||||
try:
|
||||
buffer
|
||||
except NameError:
|
||||
buffer = memoryview
|
||||
|
||||
|
||||
psucfg_errors = {
|
||||
|
@ -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)
|
||||
|
@ -21,6 +21,10 @@ try:
|
||||
xrange
|
||||
except NameError:
|
||||
xrange = range
|
||||
try:
|
||||
buffer
|
||||
except NameError:
|
||||
buffer = memoryview
|
||||
|
||||
|
||||
def decode_wireformat_uuid(rawguid):
|
||||
|
Loading…
x
Reference in New Issue
Block a user