1. Jeremy Thurgood
  2. pypy

Commits

Rocco Moretti  committed 4999fc6

Made interactive.py resistant to missing sys.stdout.softspace in user code.

  • Participants
  • Parent commits b2b1fa1
  • Branches default

Comments (0)

Files changed (1)

File pypy/interpreter/interactive.py

View file
  • Ignore whitespace
             # XXX insert exception info into the application-level sys.last_xxx
             operationerr.print_detailed_traceback(self.space)
         else:
-            if sys.stdout.softspace:
-                print
+            try:
+                if sys.stdout.softspace:
+                    print
+            except AttributeError:
+                # Don't crash if user defined stdout doesn't have softspace
+                pass
 
     def runsource(self, source, ignored_filename="<input>", symbol="single"):
         hacked_filename = '<inline>\n'+source