(self)
| 199 | self.name = name |
| 200 | |
| 201 | def __del__(self): |
| 202 | try: |
| 203 | context.remove_function(self.name) |
| 204 | except TypeError: |
| 205 | # Suppress some exceptions, mainly for the case when we're running on |
| 206 | # module deletion. Things that can go wrong include the context module |
| 207 | # already being unloaded, self._handle._handle_data no longer being |
| 208 | # valid, and so on. Printing warnings in these cases is silly |
| 209 | # (exceptions raised from __del__ are printed as warnings to stderr). |
| 210 | pass # 'NoneType' object is not callable when the handle has been |
| 211 | # partially unloaded. |
| 212 | except AttributeError: |
| 213 | pass # 'NoneType' object has no attribute 'eager_mode' when context has |
| 214 | # been unloaded. Will catch other module unloads as well. |
| 215 | |
| 216 | |
| 217 | class _DefinedFunction(object): |
nothing calls this directly
no test coverage detected