commit 8472bc2706377c93752b2f0b8429b0d18639b65c Author: Martin Kletzander Date: Fri Apr 5 15:12:15 2013 +0200 setup: make build work on python 3 In python 3, the string module doesn't have 'split' function anymore and users are encouraged to use '.split()' on the string itself. Also 'map()' is lazy and returns an iterable map object, but setup expects only a list, so it has to be wrapped in 'list()'. All of this works with python2 as well. Signed-off-by: Martin Kletzander diff --git a/setup.py b/setup.py index d0d0429..a42a9b7 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,16 @@ -import os, string +import os from distutils.core import setup, Extension pc = os.popen("pkg-config --cflags-only-I glib-2.0 libxml-2.0 sqlite3", "r") -includes = map(lambda x:x[2:], string.split(pc.readline())) +includes = list(map(lambda x:x[2:], pc.readline().split())) pc.close() pc = os.popen("pkg-config --libs-only-l glib-2.0 libxml-2.0 sqlite3", "r") -libs = map(lambda x:x[2:], string.split(pc.readline())) +libs = list(map(lambda x:x[2:], pc.readline().split())) pc.close() pc = os.popen("pkg-config --libs-only-L glib-2.0 libxml-2.0 sqlite3", "r") -libdirs = map(lambda x:x[2:], string.split(pc.readline())) +libdirs = list(map(lambda x:x[2:], pc.readline().split())) pc.close() module = Extension('_sqlitecache',