src/eric7/CodeFormatting/IsortFormattingDialog.py

branch
eric7
changeset 10409
8d888f38bf89
parent 10136
ae09a4a9b0d1
child 10439
21c28b0f9e41
diff -r 8824b6d71a11 -r 8d888f38bf89 src/eric7/CodeFormatting/IsortFormattingDialog.py
--- a/src/eric7/CodeFormatting/IsortFormattingDialog.py	Thu Dec 14 17:46:17 2023 +0100
+++ b/src/eric7/CodeFormatting/IsortFormattingDialog.py	Fri Dec 15 14:07:43 2023 +0100
@@ -91,9 +91,11 @@
         # overwrites these. If the project is not passed, the isort config is based on
         # the isort defaults.
         if project:
-            # clear the caches in order to force a re-read of config files
-            settings._get_config_data.cache_clear()
-            settings._find_config.cache_clear()
+            with contextlib.suppress(AttributeError):
+                # for isort < 5.13.0
+                # clear the caches in order to force a re-read of config files
+                settings._get_config_data.cache_clear()
+                settings._find_config.cache_clear()
         try:
             self.__isortConfig = (
                 settings.Config(settings_path=project.getProjectPath(), **self.__config)

eric ide

mercurial