提交 09510989 authored 作者: Frederic's avatar Frederic

print the warning with the right stack level.

上级 abb8daf0
...@@ -64,7 +64,8 @@ class OrderedUpdates(OrderedDict): ...@@ -64,7 +64,8 @@ class OrderedUpdates(OrderedDict):
# Warn about non-determinism. # Warn about non-determinism.
warnings.warn('Updating an `OrderedUpdates` with a ' warnings.warn('Updating an `OrderedUpdates` with a '
'non-ordered dictionary with 2+ elements could ' 'non-ordered dictionary with 2+ elements could '
'make your code non-deterministic') 'make your code non-deterministic',
stacklevel=2)
for key, val in OrderedDict(other).iteritems(): for key, val in OrderedDict(other).iteritems():
if key in self: if key in self:
if self[key] == val: if self[key] == val:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论