mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
sip_to_pjsip: Enable python3 compatibility.
The script remains compatible with Python 2.7 but now also works with Python 3.3 and newer; to ease the migration from chan_sip to chan_pjsip. ASTERISK-27811 Change-Id: I59cc6b52a1a89777eebcf25b3023bdf93babf835
This commit is contained in:
committed by
Corey Farrell
parent
9f1e1d153a
commit
2d81709ab1
@@ -3,10 +3,12 @@
|
||||
# copied from http://code.activestate.com/recipes/576693/
|
||||
|
||||
try:
|
||||
from thread import get_ident as _get_ident
|
||||
from threading import get_ident as _get_ident
|
||||
except ImportError:
|
||||
from dummy_thread import get_ident as _get_ident
|
||||
|
||||
try:
|
||||
from thread import get_ident as _get_ident
|
||||
except ImportError:
|
||||
from dummy_thread import get_ident as _get_ident
|
||||
try:
|
||||
from _abcoll import KeysView, ValuesView, ItemsView
|
||||
except ImportError:
|
||||
@@ -267,11 +269,11 @@ class MultiOrderedDict(OrderedDict):
|
||||
|
||||
def __setitem__(self, key, val, i=None):
|
||||
if key not in self:
|
||||
# print "__setitem__ key = ", key, " val = ", val
|
||||
# print("__setitem__ key = " + key + " val = " + val)
|
||||
OrderedDict.__setitem__(
|
||||
self, key, val if isinstance(val, list) else [val])
|
||||
return
|
||||
# print "inserting key = ", key, " val = ", val
|
||||
# print("inserting key = " + key + " val = " + val)
|
||||
vals = self[key]
|
||||
if i is None:
|
||||
i = len(vals)
|
||||
|
Reference in New Issue
Block a user