diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-04-02 11:16:18 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-04-02 11:16:18 +0200 |
commit | 1f49833d4fc449d54c95c3235b5c18523e6f8d69 (patch) | |
tree | ae027273609339b9b89e3e546552af7a7afb23e7 /external/unbound/libunbound/python | |
parent | Merge pull request #248 (diff) | |
download | monero-1f49833d4fc449d54c95c3235b5c18523e6f8d69.tar.xz |
update unbound from upstream
Diffstat (limited to '')
-rw-r--r-- | external/unbound/libunbound/python/libunbound.i | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/external/unbound/libunbound/python/libunbound.i b/external/unbound/libunbound/python/libunbound.i index 313c74862..1bef79f22 100644 --- a/external/unbound/libunbound/python/libunbound.i +++ b/external/unbound/libunbound/python/libunbound.i @@ -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" @@ -699,7 +703,7 @@ Result: ['74.125.43.147', '74.125.43.99', '74.125.43.103', '74.125.43.104'] while (idx < slen): complen = ord(s[idx]) # In python 3.x `str()` converts the string to unicode which is the expected text string type - res.append(str(s[idx+1:idx+1+complen])) + res.append(str(s[idx+1:idx+1+complen].decode())) idx += complen + 1 return res |