Changeset 1533

Show
Ignore:
Timestamp:
07/14/08 19:43:08 (5 months ago)
Author:
nick
Message:

Merged changes from source:pyamf/branches/class-init-args-322

Location:
pyamf/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pyamf/trunk

    • Property svn:mergeinfo
      •  

        old new  
        1 /pyamf/branches/class-init-args-322:1527-1528 
         1/pyamf/branches/class-init-args-322:1527-1528,1530-1532 
        22/pyamf/trunk:1525-1526 
  • pyamf/trunk/pyamf/__init__.py

    r1529 r1533  
    638638    if hasattr(klass, '__init__') and hasattr(klass.__init__, 'im_func'): 
    639639        klass_func = klass.__init__.im_func 
    640         # Number of arguments - number of default values 
    641         if klass_func.func_code.co_argcount - len(klass_func.func_defaults or []) > 1: 
     640        # built-in classes don't have func_code 
     641        # required arguments = Number of arguments - number of default values 
     642        if hasattr(klass_func, 'func_code') and ( 
     643           klass_func.func_code.co_argcount - len(klass_func.func_defaults or []) > 1): 
    642644            raise TypeError("pyamf doesn't support required init arguments") 
    643645