Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Felke <martin.felke@googlemail.com>2022-06-13 23:58:18 +0300
committerMartin Felke <martin.felke@googlemail.com>2022-06-13 23:58:18 +0300
commite72fe78e1d08eb8c5e9af124068edead7f896557 (patch)
treed1106bb4b0c31f40f9aedd34a6e8c04c38498d87 /development_edit_operator.py
parent514aca8ac9cf485a27676fca5441a6445aef498b (diff)
Fix T98840: Recursion Error with Development - Edit Operator Addon
In the prior versions of this addon I had to generate a list of builtin and standard python modules, which need to be excluded in the walk function. This function is being called recursively over all blender py modules and addon modules. Certain builtin or standard modules of python seem to have some recursion in their module structure, which needs to be avoided. Since Python 3.10, you can use 'sys.stdlib_module_names' for a basic list. Possibly the old method generated an incomplete list.
Diffstat (limited to 'development_edit_operator.py')
-rw-r--r--development_edit_operator.py38
1 files changed, 22 insertions, 16 deletions
diff --git a/development_edit_operator.py b/development_edit_operator.py
index e51df36e..0936f57b 100644
--- a/development_edit_operator.py
+++ b/development_edit_operator.py
@@ -1,11 +1,27 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
bl_info = {
"name": "Edit Operator Source",
"author": "scorpion81",
- "version": (1, 2, 2),
- "blender": (2, 80, 0),
+ "version": (1, 2, 3),
+ "blender": (3, 2, 0),
"location": "Text Editor > Sidebar > Edit Operator",
"description": "Opens source file of chosen operator or call locations, if source not available",
"warning": "",
@@ -30,18 +46,6 @@ from bpy.props import (
IntProperty
)
-def stdlib_excludes():
- #need a handy list of modules to avoid walking into
- import distutils.sysconfig as sysconfig
- excludes = []
- std_lib = sysconfig.get_python_lib(standard_lib=True)
- for top, dirs, files in os.walk(std_lib):
- for nm in files:
- if nm != '__init__.py' and nm[-3:] == '.py':
- excludes.append(os.path.join(top, nm)[len(std_lib)+1:-3].replace('\\','.'))
-
- return excludes
-
def make_loc(prefix, c):
#too long and not helpful... omitting for now
space = ""
@@ -219,8 +223,10 @@ class TEXT_OT_EditOperator(Operator):
def show_calls(self, context):
import bl_ui
import addon_utils
+ import sys
- exclude = stdlib_excludes()
+ exclude = []
+ exclude.extend(sys.stdlib_module_names)
exclude.append("bpy")
exclude.append("sys")