diff --git a/spyder_kernels/customize/spydercustomize.py b/spyder_kernels/customize/spydercustomize.py index 99c20898..2ac975ae 100644 --- a/spyder_kernels/customize/spydercustomize.py +++ b/spyder_kernels/customize/spydercustomize.py @@ -11,7 +11,6 @@ # Spyder consoles sitecustomize # -import logging import os import pdb import sys @@ -239,7 +238,7 @@ def _patched_preparation_data(name): # ============================================================================= -# os adjustments +# OS adjustments # ============================================================================= # This is necessary to have better support for Rich and Colorama. def _patched_get_terminal_size(fd=None): @@ -253,6 +252,17 @@ def _patched_get_terminal_size(fd=None): # ============================================================================= pdb.Pdb = SpyderPdb + +# ============================================================================= +# Remove TMPDIR env var in case it was set by Spyder +# ============================================================================= +# See spyder-ide/spyder#22382 for the details. +try: + os.environ.pop("TMPDIR") +except KeyError: + pass + + # ============================================================================= # PYTHONPATH and sys.path Adjustments # =============================================================================