$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r55441 - sandbox-branches/bhy/py3k/tools/build/v2/tools
From: divinekid_at_[hidden]
Date: 2009-08-07 02:08:34
Author: bhy
Date: 2009-08-07 02:08:32 EDT (Fri, 07 Aug 2009)
New Revision: 55441
URL: http://svn.boost.org/trac/boost/changeset/55441
Log:
corrected python version checking for 2to3
Text files modified: 
   sandbox-branches/bhy/py3k/tools/build/v2/tools/python.jam |    32 +++++++++++++-------------------        
   1 files changed, 13 insertions(+), 19 deletions(-)
Modified: sandbox-branches/bhy/py3k/tools/build/v2/tools/python.jam
==============================================================================
--- sandbox-branches/bhy/py3k/tools/build/v2/tools/python.jam	(original)
+++ sandbox-branches/bhy/py3k/tools/build/v2/tools/python.jam	2009-08-07 02:08:32 EDT (Fri, 07 Aug 2009)
@@ -1064,24 +1064,10 @@
 
 IMPORT python : python-extension : : python-extension ;
 
-rule is-py3
-{
-    #TODO(bhy) this may not the correct way to get Python verison,
-    # since it seems the 'python' feature can have other values. Should be checked with volodya
-    local version = [ feature.values python ] ;
-    if $(version) >= 3.0
-    {
-        return true ;
-    }
-}
-
 rule py2to3
 {
     common.copy $(>) $(<) ;
-    if [ is-py3 ]
-    {
-        2to3 $(<) ;
-    }
+    2to3 $(<) ;
 }
 
 actions 2to3
@@ -1109,6 +1095,7 @@
 
     rule run ( project name ? : property-set : sources * : multiple ? )
     {
+        local pyversion = [ $(property-set).get <python> ] ;
         local python ;
         local other-pythons ;
     
@@ -1124,10 +1111,17 @@
         # Make new target that converting Python source by 2to3 when running with Python 3.
         local rule make-2to3-source ( source )
         {
-            local a = [ new action $(source) : python.py2to3 : $(property-set) ] ;
-            local t =  [ utility.basename [ $(s).name ] ] ;
-            local p = [ new file-target $(t) : PY : $(project) : $(a) ] ;
-            return $(p) ; 
+            if $(pyversion) >= 3.0
+            {
+                local a = [ new action $(source) : python.py2to3 : $(property-set) ] ;
+                local t =  [ utility.basename [ $(s).name ] ] ;
+                local p = [ new file-target $(t) : PY : $(project) : $(a) ] ;
+                return $(p) ;
+            }
+            else
+            {
+                return $(source) ;
+            }
         }
 
         for local s in $(sources)