Switch to unified view

a/src/python/recoll/setup.py.in b/src/python/recoll/setup.py.in
...
...
6
top = os.path.join('..', '..')
6
top = os.path.join('..', '..')
7
7
8
library_dirs = [os.path.join(top, 'lib')]
8
library_dirs = [os.path.join(top, 'lib')]
9
libraries = ['recoll']
9
libraries = ['recoll']
10
10
11
if os.environ.has_key('libdir') and os.environ['libdir'] != "":
11
if 'libdir' in os.environ and os.environ['libdir'] != "":
12
    runtime_library_dirs = [os.path.join(os.environ['libdir'], 'recoll')]
12
    runtime_library_dirs = [os.path.join(os.environ['libdir'], 'recoll')]
13
else:
13
else:
14
    runtime_library_dirs = [os.path.join('@prefix@', 'lib', 'recoll')]
14
    runtime_library_dirs = [os.path.join('@prefix@', 'lib', 'recoll')]
15
15
16
# Verify that the Recoll library was compiled with the PIC options
16
# Verify that the Recoll library was compiled with the PIC options
17
localdefs = os.path.join(top, 'mk', 'localdefs')
17
localdefs = os.path.join(top, 'mk', 'localdefs')
18
try:
18
try:
19
    lines = open(localdefs, 'r').readlines()
19
    lines = open(localdefs, 'r').readlines()
20
except:
20
except:
21
    print 'You need to build recoll first. Use configure --enable-pic'
21
    print('You need to build recoll first. Use configure --enable-pic')
22
    sys.exit(1)
22
    sys.exit(1)
23
picok = False
23
picok = False
24
for line in lines:
24
for line in lines:
25
    if line.find('PICFLAGS') == 0:
25
    if line.find('PICFLAGS') == 0:
26
        picok = True
26
        picok = True
27
        break
27
        break
28
if not picok:
28
if not picok:
29
    print 'You need to rebuild recoll with PIC enabled. Use configure --enable-pic and make clean'
29
    print('You need to rebuild recoll with PIC enabled. Use configure --enable-pic and make clean')
30
    sys.exit(1)
30
    sys.exit(1)
31
31
32
                               
32
                               
33
module1 = Extension('recoll',
33
module1 = Extension('recoll',
34
                    define_macros = [('MAJOR_VERSION', '1'),
34
                    define_macros = [('MAJOR_VERSION', '1'),