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 return obj
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)