use os.remove rather then unlink (the same but all other areas use 'remove')

This commit is contained in:
Campbell Barton
2013-08-29 06:02:19 +00:00
parent bd2f6c5907
commit 73068ca3df

View File

@@ -1286,10 +1286,10 @@ class WM_OT_blenderplayer_start(Operator):
self.report({'ERROR'}, "Player path: %r not found" % player_path)
return {'CANCELLED'}
filepath = bpy.data.filepath+'~' if bpy.data.is_saved else os.path.join(bpy.app.tempdir, "game.blend")
filepath = bpy.data.filepath + '~' if bpy.data.is_saved else os.path.join(bpy.app.tempdir, "game.blend")
bpy.ops.wm.save_as_mainfile('EXEC_DEFAULT', filepath=filepath, copy=True)
subprocess.call([player_path, filepath])
os.unlink(filepath)
os.remove(filepath)
return {'FINISHED'}