[Bf-extensions-cvs] [92899421] master: Fix svg_util_test not working anymore from direct manual execution.

Bastien Montagne noreply at git.blender.org
Thu Sep 19 12:27:50 CEST 2019


Commit: 92899421cca252229101e1d9506f5e83ad66d149
Author: Bastien Montagne
Date:   Thu Sep 19 12:26:50 2019 +0200
Branches: master
https://developer.blender.org/rBA92899421cca252229101e1d9506f5e83ad66d149

Fix svg_util_test not working anymore from direct manual execution.

Annoying hack, but cannot think of any better solution for now.

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

M	io_curve_svg/svg_util_test.py

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

diff --git a/io_curve_svg/svg_util_test.py b/io_curve_svg/svg_util_test.py
index 340a6088..68f3a8b0 100755
--- a/io_curve_svg/svg_util_test.py
+++ b/io_curve_svg/svg_util_test.py
@@ -20,7 +20,13 @@
 
 # <pep8 compliant>
 
-from .svg_util import parse_array_of_floats
+
+# XXX Not really nice, but that hack is needed to allow execution of that test
+#     from both automated CTest and by directly running the file manually...
+if __name__ == '__main__':
+    from svg_util import parse_array_of_floats
+else:
+    from .svg_util import parse_array_of_floats
 import unittest



More information about the Bf-extensions-cvs mailing list