MCPcopy Create free account
hub / github.com/psf/cachecontrol / __getattr__

Method __getattr__

cachecontrol/filewrapper.py:41–51  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

39 self.__callback = callback
40
41 def __getattr__(self, name: str) -> Any:
42 # The vagaries of garbage collection means that self.__fp is
43 # not always set. By using __getattribute__ and the private
44 # name[0] allows looking up the attribute value and raising an
45 # AttributeError when it doesn't exist. This stop things from
46 # infinitely recursing calls to getattr in the case where
47 # self.__fp hasn't been set.
48 #
49 # [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers
50 fp = self.__getattribute__("_CallbackFileWrapper__fp")
51 return getattr(fp, name)
52
53 def __is_fp_closed(self) -> bool:
54 try:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected