提交 3733f854 authored 作者: nouiz's avatar nouiz

Merge pull request #443 from lamblin/fix_borrow_warning

Fix comparison of "borrow" flag.
...@@ -294,7 +294,9 @@ class Param(object): ...@@ -294,7 +294,9 @@ class Param(object):
# mutable=True should require borrow=True. Raise warning when borrow is explicitely set # mutable=True should require borrow=True. Raise warning when borrow is explicitely set
# to False with mutable=True. # to False with mutable=True.
if mutable: if mutable:
if not borrow: # Do not compare with "if not borrow", because borrow can be None,
# and "not None" would be True.
if borrow is False:
_logger.warning("Symbolic input for variable %s (name=%s) has " _logger.warning("Symbolic input for variable %s (name=%s) has "
"flags mutable=True, borrow=False. This combination is " "flags mutable=True, borrow=False. This combination is "
"incompatible since mutable=True implies that the " "incompatible since mutable=True implies that the "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论