mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-15 08:37:51 -05:00
- Fix pyunbound ord call, portable for python 2 and 3.
git-svn-id: file:///svn/unbound/trunk@3313 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
f890257321
commit
03d1afc32a
2 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
12 January 2015: Wouter
|
||||
- Cast sun_len sizeof to socklen_t.
|
||||
- Fix pyunbound ord call, portable for python 2 and 3.
|
||||
|
||||
7 January 2015: Wouter
|
||||
- Fix warnings in pythonmod changes.
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@
|
|||
|
||||
%pythoncode %{
|
||||
import encodings.idna
|
||||
try:
|
||||
import builtins
|
||||
except ImportError:
|
||||
import __builtin__ as builtins
|
||||
|
||||
# Ensure compatibility with older python versions
|
||||
if 'bytes' not in vars():
|
||||
|
|
@ -52,7 +56,7 @@
|
|||
def ord(s):
|
||||
if isinstance(s, int):
|
||||
return s
|
||||
return __builtins__.ord(s)
|
||||
return builtins.ord(s)
|
||||
%}
|
||||
|
||||
//%include "doc.i"
|
||||
|
|
|
|||
Loading…
Reference in a new issue