Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Lib/symtable.py

    r2 r388  
    44from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
    55     DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC,
    6      SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
    7 
    8 import warnings
     6     SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL, LOCAL)
     7
    98import weakref
    109
     
    1211
    1312def symtable(code, filename, compile_type):
    14     raw = _symtable.symtable(code, filename, compile_type)
    15     for top in raw.itervalues():
    16         if top.name == 'top':
    17             break
     13    top = _symtable.symtable(code, filename, compile_type)
    1814    return _newSymbolTable(top, filename)
    1915
     
    139135    def get_locals(self):
    140136        if self.__locals is None:
    141             self.__locals = self.__idents_matching(lambda x:x & DEF_BOUND)
     137            locs = (LOCAL, CELL)
     138            test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs
     139            self.__locals = self.__idents_matching(test)
    142140        return self.__locals
    143141
     
    192190        return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT))
    193191
    194     def is_vararg(self):
    195         warnings.warn("is_vararg() is obsolete and will be removed",
    196                       DeprecationWarning, 2)
    197         return False
    198 
    199     def is_keywordarg(self):
    200         warnings.warn("is_keywordarg() is obsolete and will be removed",
    201                       DeprecationWarning, 2)
    202         return False
    203 
    204192    def is_declared_global(self):
    205193        return bool(self.__scope == GLOBAL_EXPLICIT)
     
    216204    def is_assigned(self):
    217205        return bool(self.__flags & DEF_LOCAL)
    218 
    219     def is_in_tuple(self):
    220         warnings.warn("is_in_tuple() is obsolete and will be removed",
    221                       DeprecationWarning, 2)
    222206
    223207    def is_namespace(self):
Note: See TracChangeset for help on using the changeset viewer.