diff --git a/google/colab/_shell.py b/google/colab/_shell.py index 1471145c..4bda9c61 100644 --- a/google/colab/_shell.py +++ b/google/colab/_shell.py @@ -90,7 +90,8 @@ def get_code_name(self, raw_code, code, number): code_name = super().get_code_name(raw_code, code, number) if code_name.endswith('.py'): path = pathlib.Path(code_name) - code_name = f'/tmp/ipython-input-{path.name}' + pid = os.getpid() + code_name = f'/tmp/ipython-input-{pid}/{path.name}' return code_name