From bc7da29e6bbbf60bbd76808d5bb9b79a27ff673f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 16 Dec 2011 10:57:05 -0800 Subject: [PATCH] scons: python 2.5 compatibility --- bindings/python/build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/python/build.py b/bindings/python/build.py index caea79ce0..7ad2385a1 100644 --- a/bindings/python/build.py +++ b/bindings/python/build.py @@ -142,7 +142,11 @@ paths += "__all__ = [mapniklibpath,inputpluginspath,fontscollectionpath]\n" if not os.path.exists('mapnik'): os.mkdir('mapnik') -file('mapnik/paths.py','w').write(paths % (os.path.relpath(env['MAPNIK_LIB_DIR'],target_path))) + +if hasattr(os.path,'relpath'): # python 2.6 and above + file('mapnik/paths.py','w').write(paths % (os.path.relpath(env['MAPNIK_LIB_DIR'],target_path))) +else: + file('mapnik/paths.py','w').write(paths % (env['MAPNIK_LIB_DIR'])) # force open perms temporarily so that `sudo scons install` # does not later break simple non-install non-sudo rebuild