[Asterisk-code-review] Begin work on python3 compatability. (testsuite[master])
Corey Farrell
asteriskteam at digium.com
Thu Jul 5 11:43:00 CDT 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/8854 )
Change subject: Begin work on python3 compatability.
......................................................................
Patch Set 9:
(2 comments)
https://gerrit.asterisk.org/#/c/8854/9/lib/python/asterisk/self_test/test_matcher.py
File lib/python/asterisk/self_test/test_matcher.py:
https://gerrit.asterisk.org/#/c/8854/9/lib/python/asterisk/self_test/test_matcher.py@1
PS9, Line 1: #!/usr/bin/env python
> Does test2_matcher still need to exist after the python2/3 compat changes go in?
No. test2_matcher was used because this test has to import from `asterisk.matcher`. This review makes that import possible from python3 so we no longer have to restrict this test to python2 only.
https://gerrit.asterisk.org/#/c/8854/9/runtests.py
File runtests.py:
https://gerrit.asterisk.org/#/c/8854/9/runtests.py@677
PS9, Line 677: tbl = {}
: for r in bad_chars:
: # we do +1 here to include the last item
: for i in range(r[0], r[1] + 1):
: tbl[chr(i)] = None
: return data.translate(tbl)
> I think I am misreading something here. […]
Python2: https://docs.python.org/2/library/string.html#string.translate
Python3: https://docs.python.org/3/library/stdtypes.html#str.translate
Python3 does not support the 'deletechars' string. Setting hash entries to None is supported by python2 and is the only way in python3.
--
To view, visit https://gerrit.asterisk.org/8854
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If76c2d3e11e4ab4552d0df7841287c8bb2de7918
Gerrit-Change-Number: 8854
Gerrit-PatchSet: 9
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Thu, 05 Jul 2018 16:43:00 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180705/7f67d344/attachment.html>
More information about the asterisk-code-review
mailing list