[Asterisk-code-review] Try construct.legacy as Python module first. (testsuite[master])
Jenkins2
asteriskteam at digium.com
Thu Jun 7 13:51:24 CDT 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/9119 )
Change subject: Try construct.legacy as Python module first.
......................................................................
Try construct.legacy as Python module first.
Since version 2.6, the Python module 'construct' is not forward compatible. Some
disitributions still offer version 2.5 via
import construct_legacy
Until the Asterisk Test Suite is updated, let us first try to import the legacy
version. For example since Ubuntu 18.04 LTS, you go for
sudo apt install python-construct.legacy
ASTERISK-27893
Change-Id: Ia5a6b205e222156bb9f0adca4611fbe879d2bd1c
---
M lib/python/asterisk/pcap.py
M tests/channels/SIP/pcap_demo/run-test
M tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py
M tests/hep/hep_capture_node.py
4 files changed, 18 insertions(+), 5 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/lib/python/asterisk/pcap.py b/lib/python/asterisk/pcap.py
index ee1020d..d39574a 100644
--- a/lib/python/asterisk/pcap.py
+++ b/lib/python/asterisk/pcap.py
@@ -19,8 +19,12 @@
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
-from construct import *
-from construct.protocols.ipstack import ip_stack
+try:
+ from construct_legacy import *
+ from construct_legacy.protocols.ipstack import ip_stack
+except ImportError:
+ from construct import *
+ from construct.protocols.ipstack import ip_stack
try:
from yappcap import PcapOffline
PCAP_AVAILABLE = True
diff --git a/tests/channels/SIP/pcap_demo/run-test b/tests/channels/SIP/pcap_demo/run-test
index bc0f27c..7b3122b 100755
--- a/tests/channels/SIP/pcap_demo/run-test
+++ b/tests/channels/SIP/pcap_demo/run-test
@@ -11,7 +11,10 @@
from sip_message import SIPMessage, SIPMessageTest
from twisted.internet import reactor
-from construct.protocols.ipstack import ip_stack
+try:
+ from construct_legacy.protocols.ipstack import ip_stack
+except ImportError:
+ from construct.protocols.ipstack import ip_stack
logger = logging.getLogger(__name__)
test1 = [
diff --git a/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py b/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py
index 38ff430..2e325f5 100644
--- a/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py
+++ b/tests/channels/pjsip/rtp/rtp_keepalive/base/rtp.py
@@ -13,7 +13,10 @@
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
-from construct import *
+try:
+ from construct_legacy import *
+except ImportError:
+ from construct import *
sys.path.append('lib/python')
diff --git a/tests/hep/hep_capture_node.py b/tests/hep/hep_capture_node.py
index 8170213..f663056 100644
--- a/tests/hep/hep_capture_node.py
+++ b/tests/hep/hep_capture_node.py
@@ -21,7 +21,10 @@
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
-from construct import *
+try:
+ from construct_legacy import *
+except ImportError:
+ from construct import *
LOGGER = logging.getLogger(__name__)
--
To view, visit https://gerrit.asterisk.org/9119
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia5a6b205e222156bb9f0adca4611fbe879d2bd1c
Gerrit-Change-Number: 9119
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180607/0ea1726a/attachment-0001.html>
More information about the asterisk-code-review
mailing list