Commit 1da0b5e8 authored by André Anjos's avatar André Anjos 💬

Replace the use of string.maketrans with something that can also work with Python3

parent de834bdd
......@@ -92,8 +92,15 @@ def pkgconfig(package):
for k, v in kw.items(): # remove duplicated
kw[k] = uniq(v)
try:
# Python 3 style
maketrans = ''.maketrans
except AttributeError:
# fallback for Python 2
from string import maketrans
# adds version and HAVE flags
PACKAGE = package.upper().translate(string.maketrans(" -", "__"))
PACKAGE = package.upper().translate(maketrans(" -", "__"))
kw['define_macros'] = [
('HAVE_%s' % PACKAGE, '1'),
('%s_VERSION' % PACKAGE, '"%s"' % version),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment