fix [#31428] bpy.ops.wm.path_open only works once

This commit is contained in:
Campbell Barton 2012-05-12 21:11:48 +00:00
parent b224cbe6b6
commit 7413ab8f1f

@ -764,6 +764,7 @@ class WM_OT_path_open(Operator):
filepath = StringProperty(
subtype='FILE_PATH',
options={'SKIP_SAVE'},
)
def execute(self, context):
@ -771,7 +772,13 @@ class WM_OT_path_open(Operator):
import os
import subprocess
filepath = bpy.path.abspath(self.filepath)
filepath = self.filepath
if not filepath:
self.report({'ERROR'}, "File path was not set")
return {'CANCELLED'}
filepath = bpy.path.abspath(filepath)
filepath = os.path.normpath(filepath)
if not os.path.exists(filepath):