Changeset 184
- Timestamp:
- 05/26/08 22:35:01 (8 months ago)
- Files:
-
- trunk/pycawm/hookmanager.py (modified) (1 diff)
- trunk/pycawm/misc.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pycawm/hookmanager.py
r152 r184 287 287 for (attr, meth) in classdict.iteritems(): 288 288 if not hasattr(meth, '_wrapped_fun'): 289 if type(meth) is FunctionType:289 if isinstance(meth, FunctionType): 290 290 classdict[attr] = run_hooks(meth) 291 elif type(meth) is classmethod:291 elif isinstance(meth, classmethod): 292 292 classdict[attr] = classmethod(run_hooks( 293 293 meth.__get__(None, name).im_func)) 294 elif type(meth) is staticmethod:294 elif isinstance(meth, staticmethod): 295 295 classdict[attr] = staticmethod(run_hooks( 296 296 meth.__get__(None, name))) trunk/pycawm/misc.py
r183 r184 39 39 # ClassType is the type of old-style classes 40 40 base = tuple([cls for cls in base 41 if ( type(cls) in (TypeType, ClassType) and41 if (isinstance(cls, (TypeType, ClassType)) and 42 42 cls is not klass)]) 43 43 try: … … 50 50 or not). 51 51 Return None if the argument is not correct.""" 52 if type(fun) in (MethodType, FunctionType):52 if isinstance(fun, (MethodType, FunctionType)): 53 53 # is fun designed to be hooked? 54 54 if hasattr(fun, '_wrapped_fun'): … … 56 56 fun = fun._wrapped_fun 57 57 # normal method? 58 elif type(fun) is MethodType:58 elif isinstance(fun, MethodType): 59 59 fun = fun.im_func 60 60 # do not change the "fun" for normal functions
