Skip to content
Snippets Groups Projects
Commit 1da0b5e8 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

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

parent de834bdd
Branches
No related tags found
No related merge requests found
......@@ -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),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment