Esempio n. 1
0
File: run.py Progetto: van7hu/fanca
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.
Esempio n. 2
0
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.
Esempio n. 3
0
 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)
Esempio n. 4
0
 def test_idle_formatter(self):
     s = shell.idle_formatwarning('Test', UserWarning, 'test_warning.py', 99, 'Line of code')
     self.assertEqual(idlemsg, s)
Esempio n. 5
0
 def test_idle_formatter(self):
     s = shell.idle_formatwarning('Test', UserWarning, 'test_warning.py', 99, 'Line of code')
     self.assertEqual(idlemsg, s)
Esempio n. 6
0
 def test_idle_formatter(self):
     s = shell.idle_formatwarning("Test", UserWarning, "test_warning.py", 99, "Line of code")
     self.assertEqual(idlemsg, s)