Commits

Anonymous committed 82a665c

Fixups for Python 2.5 and Windows

  • Participants
  • Parent commits ba9c31e

Comments (0)

Files changed (4)

 """Setuptools setup file"""
 
 import sys, os
-import multiprocessing, logging
+import logging
 
 from setuptools import setup
 

File tests/test_commands.py

 import tw2.core.core as core
 import tw2.core.middleware as middleware
 
-TMP_DIR = '/tmp/tmp_test_out1'
-OUT_DIR = '/tmp/tmp_test_out2'
+TMP_DIR = os.path.join(os.environ['TEMP'], 'tmp_test_out1')
+OUT_DIR = os.path.join(os.environ['TEMP'], 'tmp_test_out2')
 
 class StdOut(StringIO.StringIO):
      def __init__(self,stdout):
         self.c = tw2.core.command.archive_tw2_resources(d)
         try:
             shutil.rmtree(OUT_DIR)
-        except Exception as e:
+        except Exception, e:
             pass
         os.mkdir(OUT_DIR)
 
         try:
             self.c.finalize_options()
             assert(False)
-        except ValueError as e:
+        except ValueError, e:
             assert(
                 str(e) == "invalid literal for int() with base 10: 'not-an-int'"
             )
 
         try:
             shutil.rmtree(OUT_DIR)
-        except Exception as e:
+        except Exception, e:
             pass
 
         self.c.initialize_options()
         core.request_local()['middleware'] = middleware.make_middleware()
         try:
             core.request_local()['resources'] = []
-        except Exception as e:
+        except Exception, e:
             pass
 
     def tearDown(self):
 
         try:
             shutil.rmtree(OUT_DIR)
-        except Exception as e:
+        except Exception, e:
             pass
 
         try:
             shutil.rmtree(TMP_DIR)
-        except Exception as e:
+        except Exception, e:
             pass
 
     def test_load_widgets(self):

File tests/test_template.py

                 assert(test.display().replace(kid_prefix, '') == '<p>TEST <p>TEST bob</p></p>')
 
     def test_genshi_abs(self):
-        twc.Widget(template='genshi_abs:tests/test.html').display()
+        twc.Widget(template='genshi_abs:test.html').display()

File tw2/core/command.py

                 self.execute(self._copy_resource_tree, (modname, fbase),
                              "Copying %s recursively into %s" %
                              (modname, self.writer.base))
-            except AttributeError as e:
+            except AttributeError, e:
                 pass