Commits

Anonymous committed 7e750db

http://scons.tigris.org/issues/show_bug.cgi?id=2345

One-line changes: Wrap pickle.dump with staticmethod(). Keep softspace in
Unbuffered wrapper class for backward compatibility with 3.x. Use ModuleType
as a factory function rather than a base class. Derive exception class from
something derived from BaseException (required for 3.x).

  • Participants
  • Parent commits dc89092

Comments (0)

Files changed (5)

File QMTest/TestCmd.py

     # so we're going to cobble up something that looks just enough
     # like its API for our purposes below.
     from types import ModuleType
-    class subprocess(ModuleType): pass
+    subprocess = ModuleType('subprocess')
 
     subprocess.PIPE = 'PIPE'
     subprocess.STDOUT = 'STDOUT'

File QMTest/TestSCons.py

                           logfile, sconf_dir, sconstruct,
                           doCheckLog=1, doCheckStdout=1):
 
-        class NoMatch:
+        class NoMatch(Exception):
             def __init__(self, p):
                 self.pos = p
 
 class Unbuffered:
     def __init__(self, file):
         self.file = file
+        self.softspace = 0  ## backward compatibility; not supported in Py3k
     def write(self, arg):
         self.file.write(arg)
         self.file.flush()

File src/engine/SCons/Util.py

         self.unique = False
 
 
-
 class Unbuffered:
     """
     A proxy class that wraps a file object, flushing after every write,
     """
     def __init__(self, file):
         self.file = file
+        self.softspace = 0  ## backward compatibility; not supported in Py3k
     def write(self, arg):
         try:
             self.file.write(arg)

File src/engine/SCons/dblite.py

   #   http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html
 
   _open = builtins.open
-  _pickle_dump = pickle.dump
+  _pickle_dump = staticmethod(pickle.dump)
   _os_chmod = os.chmod
   try:
       _os_chown = os.chown