diff options
author | Stefan Bühler <stbuehler@web.de> | 2017-11-06 19:11:30 +0100 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2017-11-08 00:02:54 -0500 |
commit | d102a7113f6978041251f362d267749f2ab33e47 (patch) | |
tree | a7e7e8f0e8f3da7a56384f731a208e4e5724d474 /SConstruct | |
parent | 2728572af3b1f75d38efdcd6fb87a38f1d236c4b (diff) | |
download | lighttpd-git-d102a7113f6978041251f362d267749f2ab33e47.tar.gz |
[scons] fix various python2/3 incompatibilities
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,4 @@ +from __future__ import print_function import os import re import string @@ -5,6 +6,11 @@ import sys from copy import copy from stat import * +try: + string_types = basestring +except NameError: + string_types = str + package = 'lighttpd' version = '1.4.48' @@ -14,7 +20,7 @@ def underscorify(id): def fail(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) - env.Exit(-1) + sys.exit(-1) class Autoconf: class RestoreEnvLibs: @@ -91,7 +97,7 @@ class Autoconf: if self.CheckCHeader(hdr): # if we have a list of headers define HAVE_ only for last one target = hdr - if not isinstance(target, basestring): + if not isinstance(target, string_types): target = target[-1] self.conf.env.Append(CPPFLAGS = [ '-DHAVE_' + underscorify(target) ]) return True @@ -632,7 +638,7 @@ elif re.compile("darwin|aix").search(env['PLATFORM']): else: env.Append(COMMON_LIB = False) -versions = string.split(version, '.') +versions = version.split('.') version_id = int(versions[0]) << 16 | int(versions[1]) << 8 | int(versions[2]) env.Append(CPPFLAGS = [ '-DLIGHTTPD_VERSION_ID=' + hex(version_id), |