Updating attenuator controller classes to use "new-type"
objects and syntax for super to work with py2.
Bug: 29547772
Change-Id: I205690388f9cbcc84693e2bfd901813731a3a547
(cherry picked from commit 25a0c5b3341677b9127ff8338f9a7da07dd70460)
diff --git a/acts/framework/acts/controllers/attenuator.py b/acts/framework/acts/controllers/attenuator.py
index cafc5b0..585fff8 100644
--- a/acts/framework/acts/controllers/attenuator.py
+++ b/acts/framework/acts/controllers/attenuator.py
@@ -83,7 +83,7 @@
pass
-class AttenuatorInstrument():
+class AttenuatorInstrument(object):
r"""This is a base class that defines the primitive behavior of all attenuator
instruments.
@@ -160,7 +160,7 @@
raise NotImplementedError("Base class should not be called directly!")
-class Attenuator():
+class Attenuator(object):
r"""This class defines an object representing a single attenuator in a remote instrument.
A user wishing to abstract the mapping of attenuators to physical instruments should use this
diff --git a/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py b/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py
index b2eeecc..2e98ec6 100644
--- a/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py
+++ b/acts/framework/acts/controllers/attenuator_lib/_tnhelper.py
@@ -29,7 +29,7 @@
return str(uc_string).encode('ASCII')
-class _TNHelper():
+class _TNHelper(object):
#This is an internal helper class for Telnet+SCPI command-based instruments.
#It should only be used by those implemention control libraries and not by any user code
# directly
diff --git a/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py b/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py
index 440a03d..d8eb78a 100644
--- a/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py
+++ b/acts/framework/acts/controllers/attenuator_lib/aeroflex/telnet.py
@@ -33,7 +33,7 @@
class AttenuatorInstrument(attenuator.AttenuatorInstrument):
def __init__(self, num_atten=0):
- super().__init__(num_atten)
+ super(AttenuatorInstrument, self).__init__(num_atten)
self._tnhelper = _tnhelper._TNHelper(tx_cmd_separator="\r\n",
rx_cmd_separator="\r\n",
diff --git a/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py b/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py
index 38ff214..2e299a3 100644
--- a/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py
+++ b/acts/framework/acts/controllers/attenuator_lib/minicircuits/telnet.py
@@ -40,7 +40,7 @@
"""
def __init__(self, num_atten=0):
- super().__init__(num_atten)
+ super(AttenuatorInstrument, self).__init__(num_atten)
self._tnhelper = _tnhelper._TNHelper(tx_cmd_separator="\r\n",
rx_cmd_separator="\r\n",
prompt="")