aboutsummaryrefslogtreecommitdiff
path: root/src/config/mmdb-convert.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/mmdb-convert.py')
-rw-r--r--src/config/mmdb-convert.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/config/mmdb-convert.py b/src/config/mmdb-convert.py
index 3a454a3fc1..a58f5d43e1 100644
--- a/src/config/mmdb-convert.py
+++ b/src/config/mmdb-convert.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python
# This software has been dedicated to the public domain under the CC0
# public domain dedication.
@@ -28,6 +28,11 @@
pieces.
"""
+# Future imports for Python 2.7, mandatory in 3.0
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
import struct
import bisect
import socket
@@ -77,7 +82,7 @@ def to_int32(s):
def to_int28(s):
"Parse a pair of big-endian 28-bit integers from bytestring s."
- a, b = unpack("!LL", s + b'\x00')
+ a, b = struct.unpack("!LL", s + b'\x00')
return (((a & 0xf0) << 20) + (a >> 8)), ((a & 0x0f) << 24) + (b >> 8)
class Tree(object):