mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-10 07:48:36 +08:00
ENH: If example fails, print traceback and carry on.
This commit is contained in:
+11
-1
@@ -69,6 +69,7 @@ import os
|
||||
import shutil
|
||||
import token
|
||||
import tokenize
|
||||
import traceback
|
||||
|
||||
import numpy as np
|
||||
import matplotlib
|
||||
@@ -247,7 +248,16 @@ def write_gallery(gallery_index, src_dir, rst_dir, cfg, depth=0):
|
||||
gallery_index.write(TOCTREE_TEMPLATE % (sub_dir + '\n '.join(ex_names)))
|
||||
|
||||
for src_name in examples:
|
||||
write_example(src_name, src_dir, rst_dir, cfg)
|
||||
|
||||
try:
|
||||
write_example(src_name, src_dir, rst_dir, cfg)
|
||||
except Exception:
|
||||
print "Exception raised while running:"
|
||||
print "%s in %s" % (src_name, src_dir)
|
||||
print '~' * 60
|
||||
traceback.print_exc()
|
||||
print '~' * 60
|
||||
continue
|
||||
|
||||
link_name = sub_dir.pjoin(src_name)
|
||||
link_name = link_name.replace(os.path.sep, '_')
|
||||
|
||||
Reference in New Issue
Block a user