Exemplo n.º 1
0
 def get_extension(self, code):
     nil = []
     obj = _extension_cache.get(code, nil)
     if obj is not nil:
         self.append(obj)
         return
     key = _inverted_registry.get(code)
     if not key:
         raise ValueError("unregistered extension code %d" % code)
     obj = self.find_class(*key)
     _extension_cache[code] = obj
     self.append(obj)
Exemplo n.º 2
0
 def get_extension(self, code):
     nil = []
     obj = _extension_cache.get(code, nil)
     if obj is not nil:
         self.append(obj)
         return
     key = _inverted_registry.get(code)
     if not key:
         raise ValueError("unregistered extension code %d" % code)
     obj = self.find_class(*key)
     _extension_cache[code] = obj
     self.append(obj)
Exemplo n.º 3
0
 def get_extension(self, code):
     nil = []
     obj = _extension_cache.get(code, nil)
     if obj is not nil:
         self.append(obj)
         return
     key = _inverted_registry.get(code)
     if not key:
         if code <= 0:
             raise UnpicklingError('EXT specifies code <= 0')
         raise ValueError('unregistered extension code %d' % code)
     obj = (self.find_class)(*key)
     _extension_cache[code] = obj
     self.append(obj)
Exemplo n.º 4
0
 def get_extension(self, code):
     nil = []
     obj = _extension_cache.get(code, nil)
     if obj is not nil:
         self.append(obj)
         return
     key = _inverted_registry.get(code)
     if not key:
         if code <= 0:  # note that 0 is forbidden
             # Corrupt or hostile pickle.
             raise UnpicklingError("EXT specifies code <= 0")
         raise ValueError("unregistered extension code %d" % code)
     obj = self.find_class(*key)
     _extension_cache[code] = obj
     self.append(obj)
Exemplo n.º 5
0
 def get_extension(self, code):
     nil = []
     obj = _extension_cache.get(code, nil)
     if obj is not nil:
         self.append(obj)
         return
     key = _inverted_registry.get(code)
     if not key:
         if code <= 0: # note that 0 is forbidden
             # Corrupt or hostile pickle.
             raise UnpicklingError("EXT specifies code <= 0");
         raise ValueError("unregistered extension code %d" % code)
     obj = self.find_class(*key)
     _extension_cache[code] = obj
     self.append(obj)