Revision: 8537
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8537&view=rev
Author:   ryanmay
Date:     2010-07-09 18:21:30 +0000 (Fri, 09 Jul 2010)

Log Message:
-----------
Some basic changes that allow setup.py to work with both Python 2 and 3.

Modified Paths:
--------------
    trunk/matplotlib/setup.py

Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py   2010-07-08 15:59:38 UTC (rev 8536)
+++ trunk/matplotlib/setup.py   2010-07-09 18:21:30 UTC (rev 8537)
@@ -76,7 +76,7 @@
 
 ext_modules = []
 
-for line in file('lib/matplotlib/__init__.py').readlines():
+for line in open('lib/matplotlib/__init__.py').readlines():
     if (line.startswith('__version__')):
         exec(line.strip())
 
@@ -235,7 +235,7 @@
         # only add them if we need them
         if provide_pytz:
             add_pytz()
-            print 'adding pytz'
+            print_raw("adding pytz")
         if provide_dateutil: add_dateutil()
 
 print_raw("")
@@ -251,14 +251,14 @@
 
 # Write the default matplotlibrc file
 if options['backend']: rc['backend'] = options['backend']
-template = file('matplotlibrc.template').read()
-file('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc)
+template = open('matplotlibrc.template').read()
+open('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc)
 
 # Write the default matplotlib.conf file
-template = file('lib/matplotlib/mpl-data/matplotlib.conf.template').read()
+template = open('lib/matplotlib/mpl-data/matplotlib.conf.template').read()
 template = template.replace("datapath = ", "#datapath = ")
 template = template.replace("    use = 'Agg'", "    use = '%s'"%rc['backend'])
-file('lib/matplotlib/mpl-data/matplotlib.conf', 'w').write(template)
+open('lib/matplotlib/mpl-data/matplotlib.conf', 'w').write(template)
 
 try: additional_params # has setupegg.py provided
 except NameError: additional_params = {}
@@ -267,8 +267,8 @@
     if options['verbose']:
         mod.extra_compile_args.append('-DVERBOSE')
 
-print 'pymods', py_modules
-print 'packages', packages
+print_raw("pymods %s" % py_modules)
+print_raw("packages %s" % packages)
 distrib = setup(name="matplotlib",
       version= __version__,
       description = "Python plotting package",


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to