[Bf-blender-cvs] [51bf1680bd1] master: Cleanup: quiet warning accessing deprecated attribute in bl_test

Campbell Barton noreply at git.blender.org
Mon Jun 7 16:10:01 CEST 2021


Commit: 51bf1680bd114cd1886f301681aa3708145a2880
Author: Campbell Barton
Date:   Mon Jun 7 15:30:23 2021 +1000
Branches: master
https://developer.blender.org/rB51bf1680bd114cd1886f301681aa3708145a2880

Cleanup: quiet warning accessing deprecated attribute in bl_test

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

M	tests/python/bl_test.py

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

diff --git a/tests/python/bl_test.py b/tests/python/bl_test.py
index 6315ffbfa9d..110b4238f6c 100644
--- a/tests/python/bl_test.py
+++ b/tests/python/bl_test.py
@@ -32,9 +32,18 @@ def replace_bpy_app_version():
     app = bpy.app
     app_fake = type(bpy)("bpy.app")
 
+    app_attr_exclude = {
+        # This causes a noisy warning every time.
+        "binary_path_python",
+    }
+
     for attr in dir(app):
-        if not attr.startswith("_"):
-            setattr(app_fake, attr, getattr(app, attr))
+        if attr.startswith("_"):
+            continue
+        if attr in app_attr_exclude:
+            continue
+
+        setattr(app_fake, attr, getattr(app, attr))
 
     app_fake.version = 0, 0, 0
     app_fake.version_string = "0.00 (sub 0)"



More information about the Bf-blender-cvs mailing list