Commits

Joshua Hughes committed 871ff7d Draft

Fix issue 2857.

This change fixes issue 2857 by changing Platform.win32._scons_file from a
function to a class.

  • Participants
  • Parent commits 0a64d3b
  • Branches issue-2857

Comments (0)

Files changed (1)

src/engine/SCons/Platform/win32.py

 
     _builtin_file = builtins.file
     _builtin_open = builtins.open
-    
-    def _scons_file(*args, **kw):
-        fp = _builtin_file(*args, **kw)
-        win32api.SetHandleInformation(msvcrt.get_osfhandle(fp.fileno()),
-                                      win32con.HANDLE_FLAG_INHERIT,
-                                      0)
-        return fp
+
+    class _scons_file(_builtin_file):
+        def __init__(self, *args, **kw):
+            _builtin_file.__init__(self, *args, **kw)
+            win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()),
+                win32con.HANDLE_FLAG_INHERIT, 0)
 
     def _scons_open(*args, **kw):
         fp = _builtin_open(*args, **kw)