[Bf-blender-cvs] [a66e5842947] master: Cleanup: correct API usage for script access

Campbell Barton noreply at git.blender.org
Thu Sep 29 09:32:44 CEST 2022


Commit: a66e58429472e0215a76a5930a14855731ca018d
Author: Campbell Barton
Date:   Thu Sep 29 17:10:22 2022 +1000
Branches: master
https://developer.blender.org/rBa66e58429472e0215a76a5930a14855731ca018d

Cleanup: correct API usage for script access

In practice this didn't cause problems, but accessing scripts via
bpy.utils.resource_path('USER') ignores the BLENDER_USER_SCRIPTS
environment variable.

===================================================================

M	tests/python/bl_load_addons.py
M	tests/python/bl_load_py_modules.py

===================================================================

diff --git a/tests/python/bl_load_addons.py b/tests/python/bl_load_addons.py
index b67bc22102c..8c90a1f93b8 100644
--- a/tests/python/bl_load_addons.py
+++ b/tests/python/bl_load_addons.py
@@ -14,7 +14,7 @@ import sys
 import importlib
 
 BLACKLIST_DIRS = (
-    os.path.join(bpy.utils.resource_path('USER'), "scripts"),
+    bpy.utils.user_resource('SCRIPTS'),
 ) + tuple(addon_utils.paths()[1:])
 BLACKLIST_ADDONS = set()
 
diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py
index 784d8984935..48087179554 100644
--- a/tests/python/bl_load_py_modules.py
+++ b/tests/python/bl_load_py_modules.py
@@ -42,7 +42,7 @@ if not bpy.app.build_options.xr_openxr:
     BLACKLIST.add("viewport_vr_preview")
 
 BLACKLIST_DIRS = (
-    os.path.join(bpy.utils.resource_path('USER'), "scripts"),
+    os.path.join(bpy.utils.user_resource('SCRIPTS')),
 ) + tuple(addon_utils.paths()[1:])



More information about the Bf-blender-cvs mailing list