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

Method __enter__

IPython/utils/_process_win32_controller.py:172–182  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

170 os.system(cmd)
171 """
172 def __enter__(self):
173 self.path = os.getcwd()
174 self.is_unc_path = self.path.startswith(r"\\")
175 if self.is_unc_path:
176 # change to c drive (as cmd.exe cannot handle UNC addresses)
177 os.chdir("C:")
178 return self.path
179 else:
180 # We return None to signal that there was no change in the working
181 # directory
182 return None
183
184 def __exit__(self, exc_type, exc_value, traceback):
185 if self.is_unc_path:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected