Check if path exists to not display an error message
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@4316 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
0839462784
commit
2ec3b7dc93
|
@ -10,8 +10,9 @@ import os
|
|||
|
||||
path = os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirectory(), 'python/events', Crossfire.ScriptParameters())
|
||||
|
||||
scripts = os.listdir(path)
|
||||
if os.path.exists(path):
|
||||
scripts = os.listdir(path)
|
||||
|
||||
for script in scripts:
|
||||
if (script.endswith('.py')):
|
||||
execfile(os.path.join(path, script))
|
||||
for script in scripts:
|
||||
if (script.endswith('.py')):
|
||||
execfile(os.path.join(path, script))
|
||||
|
|
|
@ -7,8 +7,9 @@ sys.path.insert(0, os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirector
|
|||
|
||||
path = os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirectory(), 'python/events/init')
|
||||
|
||||
scripts = os.listdir(path)
|
||||
if os.path.exists(path):
|
||||
scripts = os.listdir(path)
|
||||
|
||||
for script in scripts:
|
||||
if (script.endswith('.py')):
|
||||
execfile(os.path.join(path, script))
|
||||
for script in scripts:
|
||||
if (script.endswith('.py')):
|
||||
execfile(os.path.join(path, script))
|
||||
|
|
Loading…
Reference in New Issue