MCPcopy Create free account
hub / github.com/ipython/ipython / __exit__

Method __exit__

IPython/utils/syspathcontext.py:33–40  ·  view source on GitHub ↗
(self, type, value, traceback)

Source from the content-addressed store, hash-verified

31 self.added = False
32
33 def __exit__(self, type, value, traceback):
34 if self.added:
35 try:
36 sys.path.remove(self.dir)
37 except ValueError:
38 pass
39 # Returning False causes any exceptions to be re-raised.
40 return False
41
42class prepended_to_syspath(object):
43 """A context for prepending a directory to sys.path for a second."""

Callers

nothing calls this directly

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected