提交 6cbe47a2 authored 作者: James Bergstra's avatar James Bergstra

Raise more specific exception in optdb

上级 8157e247
...@@ -26,7 +26,7 @@ class DB(object): ...@@ -26,7 +26,7 @@ class DB(object):
# It is an instance of a DB.In the tests for example, # It is an instance of a DB.In the tests for example,
# this is not always the case. # this is not always the case.
if not isinstance(obj, (DB, opt.Optimizer, opt.LocalOptimizer)): if not isinstance(obj, (DB, opt.Optimizer, opt.LocalOptimizer)):
raise Exception('wtf', obj) raise TypeError('Object cannot be registered in OptDB', obj)
if self.name is not None: if self.name is not None:
tags = tags + (self.name,) tags = tags + (self.name,)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论