Commits

Anonymous committed 4999fc6

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

Comments (0)

Files changed (1)

pypy/interpreter/interactive.py

             # 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