[svn r37337] Replaced try/except with a hasattr (makes that unrelated errors are no longer
obfuscated). --HG-- branch : trunk
This commit is contained in:
parent
bedeb1e640
commit
4ea388b640
|
@ -270,20 +270,13 @@ class LSession(AbstractSession):
|
||||||
if self.config.option.apigen:
|
if self.config.option.apigen:
|
||||||
from py.__.apigen.tracer.docstorage import DocStorageAccessor
|
from py.__.apigen.tracer.docstorage import DocStorageAccessor
|
||||||
apigen = py.path.local(self.config.option.apigen).pyimport()
|
apigen = py.path.local(self.config.option.apigen).pyimport()
|
||||||
|
if not hasattr(apigen, 'build'):
|
||||||
|
raise NotImplementedError("Provided script does not seem "
|
||||||
|
"to contain build function")
|
||||||
print >>sys.stderr, 'building documentation'
|
print >>sys.stderr, 'building documentation'
|
||||||
capture = py.io.OutErrCapture()
|
capture = py.io.OutErrCapture()
|
||||||
try:
|
try:
|
||||||
try:
|
apigen.build(pkgdir, DocStorageAccessor(self.docstorage))
|
||||||
apigen.build(pkgdir, DocStorageAccessor(self.docstorage))
|
|
||||||
except (ValueError, AttributeError):
|
|
||||||
#import traceback
|
|
||||||
#exc, e, tb = sys.exc_info()
|
|
||||||
#print '%s - %s' % (exc, e)
|
|
||||||
#print ''.join(traceback.format_tb(tb))
|
|
||||||
#del tb
|
|
||||||
#print '-' * 79
|
|
||||||
raise NotImplementedError("Provided script does not seem "
|
|
||||||
"to contain build function")
|
|
||||||
finally:
|
finally:
|
||||||
capture.reset()
|
capture.reset()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue