first pass at removing all python2 specific dependencies, updating python requirements.txt/setup.py/Pipfiles/Makefiles, and removing python2 compat imports
This commit is contained in:
parent
5d5ffb70c2
commit
6edd6a7fdb
13 changed files with 89 additions and 143 deletions
|
@ -9,8 +9,6 @@ import socket
|
|||
import struct
|
||||
from enum import Enum
|
||||
|
||||
from past.builtins import basestring
|
||||
|
||||
from core.api.tlv import structutils
|
||||
from core.emulator.enumerations import (
|
||||
ConfigTlvs,
|
||||
|
@ -181,7 +179,7 @@ class CoreTlvDataString(CoreTlvData):
|
|||
:return: length of data packed and the packed data
|
||||
:rtype: tuple
|
||||
"""
|
||||
if not isinstance(value, basestring):
|
||||
if not isinstance(value, str):
|
||||
raise ValueError("value not a string: %s" % type(value))
|
||||
value = value.encode("utf-8")
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@ Utilities for working with python struct data.
|
|||
|
||||
import logging
|
||||
|
||||
from past.builtins import basestring
|
||||
|
||||
|
||||
def pack_values(clazz, packers):
|
||||
"""
|
||||
|
@ -31,7 +29,7 @@ def pack_values(clazz, packers):
|
|||
|
||||
# only pack actual values and avoid packing empty strings
|
||||
# protobuf defaults to empty strings and does no imply a value to set
|
||||
if value is None or (isinstance(value, basestring) and not value):
|
||||
if value is None or (isinstance(value, str) and not value):
|
||||
continue
|
||||
|
||||
# transform values as needed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue