Boost logo

Boost Testing :

Subject: Re: [Boost-testing] Switched to Python 3
From: Maxime van Noppen (maxime_at_[hidden])
Date: 2010-10-22 12:26:59


On 10/22/2010 06:10 PM, Jim Bell wrote:
> Has anyone tried running 2to3 on it? Don't know the odds of it working.
>
> http://docs.python.org/release/3.1.2/library/2to3.html#to3-reference

Just tried, the patch produced is:

-------------------
--- run.py (original)
+++ run.py (refactored)
@@ -10,7 +10,7 @@
 import os.path
 import shutil
 import sys
-import urllib
+import urllib.request, urllib.parse, urllib.error

 #~ Using --skip-script-download is useful to avoid repeated downloading of
 #~ the regression scripts when doing the regression commands individually.
@@ -21,7 +21,7 @@

 #~ The directory this file is in.
 root = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
-print '# Running regressions in %s...' % root
+print('# Running regressions in %s...' % root)

 script_sources = [ 'collect_and_upload_logs.py', 'process_jam_log.py',
'regression.py' ]
 script_local = os.path.join(root,'tools','regression','src')
@@ -31,22 +31,22 @@
 if not no_update:
     #~ Bootstrap.
     #~ * Clear out any old versions of the scripts
- print '# Creating regression scripts at %s...' % script_dir
+ print('# Creating regression scripts at %s...' % script_dir)
     if os.path.exists(script_dir):
         shutil.rmtree(script_dir)
     os.mkdir(script_dir)
     #~ * Get new scripts, either from local working copy, or from svn
     if os.path.exists(script_local):
- print '# Copying regression scripts from %s...' % script_local
+ print('# Copying regression scripts from %s...' % script_local)
         for src in script_sources:
             shutil.copyfile( os.path.join(script_local,src),
os.path.join(script_dir,src) )
     else:
- print '# Dowloading regression scripts from %s...' % script_remote
+ print('# Dowloading regression scripts from %s...' % script_remote)
         proxy = None
         for a in sys.argv[1:]:
             if a.startswith('--proxy='):
                 proxy = {'http' : a.split('=')[1] }
- print '--- %s' %(proxy['http'])
+ print('--- %s' %(proxy['http']))
                 break
         for src in script_sources:
             urllib.FancyURLopener(proxy).retrieve(
-------------------

However it still doesn't work :

-------------------
# Running regressions in /home/yabo/boost_test...
# Creating regression scripts at
/home/yabo/boost_test/tools_regression_src...
# Dowloading regression scripts from
http://svn.boost.org/svn/boost/trunk/tools/regression/src...
Traceback (most recent call last):
  File "run.py", line 52, in <module>
    urllib.FancyURLopener(proxy).retrieve(
AttributeError: 'module' object has no attribute 'FancyURLopener'
-------------------

-- 
Maxime

Boost-testing list run by mbergal at meta-comm.com