def idle_showwarning_subproc(message, category, filename, lineno, file=None, line=None): """Show Idle-format warning after replacing warnings.showwarning. The only difference is the formatter called. """ if file is None: file = sys.stderr try: file.write(pyshell.idle_formatwarning(message, category, filename, lineno, line)) except IOError: pass # the file (probably stderr) is invalid - this warning gets lost.
def idle_showwarning_subproc(message, category, filename, lineno, file=None, line=None): """Show Idle-format warning after replacing warnings.showwarning. The only difference is the formatter called. """ if file is None: file = sys.stderr try: file.write( pyshell.idle_formatwarning(message, category, filename, lineno, line)) except IOError: pass # the file (probably stderr) is invalid - this warning gets lost.
def test_idle_formatter(self): # Will fail if format changed without regenerating idlemsg s = shell.idle_formatwarning( 'Test', UserWarning, 'test_warning.py', 99, 'Line of code') self.assertEqual(idlemsg, s)
def test_idle_formatter(self): s = shell.idle_formatwarning('Test', UserWarning, 'test_warning.py', 99, 'Line of code') self.assertEqual(idlemsg, s)