[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35275] trunk/blender/release/scripts/ui/ space_userpref.py: fix [#26252] Py error when installing addon through UI

Campbell Barton ideasman42 at gmail.com
Tue Mar 1 09:28:38 CET 2011


Revision: 35275
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35275
Author:   campbellbarton
Date:     2011-03-01 08:28:37 +0000 (Tue, 01 Mar 2011)
Log Message:
-----------
fix [#26252] Py error when installing addon through UI
Py3.1 for windows doesn't have os.path.samefile(), has been added in 3.2.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_userpref.py

Modified: trunk/blender/release/scripts/ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/ui/space_userpref.py	2011-03-01 07:52:13 UTC (rev 35274)
+++ trunk/blender/release/scripts/ui/space_userpref.py	2011-03-01 08:28:37 UTC (rev 35275)
@@ -1089,7 +1089,8 @@
         addon_path = ""
         pyfile_dir = os.path.dirname(pyfile)
         for addon_path in addon_utils.paths():
-            if os.path.samefile(pyfile_dir, addon_path):
+            # if os.path.samefile(pyfile_dir, addon_path):  # Py3.2 only!, upgrade soon!
+            if (hasattr(os.path, "samefile") and os.path.samefile(pyfile_dir, addon_path)) or pyfile_dir == addon_path:
                 self.report({'ERROR'}, "Source file is in the addon search path: %r" % addon_path)
                 return {'CANCELLED'}
         del addon_path




More information about the Bf-blender-cvs mailing list