Ticket #3413: nasty-hacks.diff

File nasty-hacks.diff, 2.2 KB (added by glyph, 8 years ago)

Some nasty hacks just so we can see trial start up and report bugs in Jython

  • twisted/python/reflect.py

     
    288288
    289289def qual(clazz):
    290290    """Return full import path of a class."""
    291     return clazz.__module__ + '.' + clazz.__name__
     291    if hasattr(clazz, '__module__'):
     292        return clazz.__module__ + '.' + clazz.__name__
     293    else:
     294        return clazz.__name__
    292295
    293296def getcurrent(clazz):
    294297    assert type(clazz) == types.ClassType, 'must be a class...'
  • twisted/python/lockfile.py

     
    2424    from os import remove as rmlink
    2525    _windows = False
    2626except:
     27    import traceback
     28    traceback.print_exc()
    2729    _windows = True
    28     from win32api import OpenProcess
    29     import pywintypes
    3030
    3131    ERROR_ACCESS_DENIED = 5
    3232    ERROR_INVALID_PARAMETER = 87
     
    3434    _open = file
    3535
    3636    def kill(pid, signal):
     37        import pywintypes
     38        from win32api import OpenProcess
    3739        try:
    3840            OpenProcess(0, 0, pid)
    3941        except pywintypes.error, e:
  • twisted/python/win32.py

     
    3131    """
    3232    return getattr(exceptions, 'WindowsError', FakeWindowsError)
    3333
    34 class FakeWindowsError(OSError):
     34class FakeWindowsError(Exception):
    3535    """
    3636    Stand-in for sometimes-builtin exception on platforms for which it
    3737    is missing.
  • twisted/application/app.py

     
    22# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
    33# See LICENSE for details.
    44
    5 import sys, os, pdb, getpass, traceback, signal, warnings
     5import sys, os, pdb, getpass, traceback, warnings
    66
    77from twisted.python import runtime, log, usage, failure, util, logfile
    88from twisted.python.versions import Version