From e0e279b85622275dfc4df0bfd5a50ec09694a9b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Sat, 30 Apr 2011 23:39:10 +0200
Subject: Remove dependency on python 2.5 in SConscript file.


diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 2d9d200..c8459e1 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -93,6 +93,8 @@ if env["max_jobs"] :
 		SetOption("num_jobs", multiprocessing.cpu_count())
 	except NotImplementedError :
 		pass
+	except ImportError :
+		pass
 
 # Default compiler flags
 if env.get("distcc", False) :
diff --git a/Swiften/SConscript b/Swiften/SConscript
index f151d3a..e00e59b 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -1,4 +1,4 @@
-import os, re, Version
+import os, re, Version, os.path
 
 Import("env")
 
@@ -359,6 +359,9 @@ if env["SCONS_STAGE"] == "build" :
 		])
 	
 	# Generate the Swiften header
+	def relpath(path, start) :
+		i = len(os.path.commonprefix([path, start]))
+		return path[i+1:]
 	swiften_header = "#pragma once\n"
 	swiften_includes = []
 	top_path = env.Dir("..").abspath
@@ -368,7 +371,7 @@ if env["SCONS_STAGE"] == "build" :
 		for file in files :
 			if not file.endswith(".h") :
 				continue
-			include = os.path.relpath(os.path.join(root, file), top_path)
+			include = relpath(os.path.join(root, file), top_path)
 			swiften_includes.append(include)
 			# Private modules
 			if root.endswith("Config") or root.endswith("Compress") :
-- 
cgit v0.10.2-6-g49f6