[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25922] trunk/blender/release/scripts/ modules/bpy/__init__.py: [#20646] 2. 5 does not load python scripts with multiple dots in the filename

Campbell Barton ideasman42 at gmail.com
Tue Jan 12 11:04:03 CET 2010


Revision: 25922
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25922
Author:   campbellbarton
Date:     2010-01-12 11:04:03 +0100 (Tue, 12 Jan 2010)

Log Message:
-----------
[#20646] 2.5 does not load python scripts with multiple dots in the filename
- not a bug so add a warning if people add scripts with invalid names like this.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy/__init__.py

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2010-01-12 08:46:38 UTC (rev 25921)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2010-01-12 10:04:03 UTC (rev 25922)
@@ -47,6 +47,10 @@
     t_main = time.time()
 
     def test_import(module_name):
+        if "." in module_name:
+            print("Ignoring '%s', can't import files containing multiple periods." % module_name)
+            return None
+
         try:
             t = time.time()
             ret = __import__(module_name)





More information about the Bf-blender-cvs mailing list