Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1396: util.diff

File util.diff, 1.1 KB (added by Chris Arndt, 4 years ago)
  • util.py

    ==========================
     
    178178        return False 
    179179    while frame.f_back: 
    180180        frame = frame.f_back 
    181         if frame.f_code.co_name == func_name: 
    182             args = getargvalues(frame)[3] 
    183             for key in kw.iterkeys(): 
    184                 try: 
    185                     if kw[key] != args[key]: 
    186                         continue 
    187                 except KeyError, TypeError: 
    188                     continue 
    189             if key or not args: 
    190                 return True 
     181        try: 
     182            if frame.f_code.co_name == func_name: 
     183                args = getargvalues(frame)[3] 
     184                for key in kw.iterkeys(): 
     185                    try: 
     186                        if kw[key] != args[key]: 
     187                            raise StopIteration() 
     188                    except KeyError, TypeError: 
     189                        raise StopIteration() 
     190                if key or not args: 
     191                    return True 
     192        except StopIteration: 
     193            pass 
    191194    return False 
    192195 
    193196def arg_index(func, argname):