summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-04-18 22:29:53 +0200
committerStefan Behnel <stefan_ml@behnel.de>2020-04-18 23:08:06 +0200
commit566ecc3b91262cc5318ccf5f5f16e4cd0fd9a789 (patch)
tree7ad08c148f648a396bdd3f903eee6c4fda060970
parentf18e3c9f9ce35ebf2cf2713775f35c47351e9c15 (diff)
downloadcython-566ecc3b91262cc5318ccf5f5f16e4cd0fd9a789.tar.gz
Increase warning level for legacy "dict in annotations" typing.
-rw-r--r--Cython/Compiler/ExprNodes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index dcd327923..8ff912ca3 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -13677,7 +13677,7 @@ class AnnotationNode(ExprNode):
explicit_pytype = explicit_ctype = False
if annotation.is_dict_literal:
warning(annotation.pos,
- "Dicts should no longer be used as type annotations. Use 'cython.int' etc. directly.")
+ "Dicts should no longer be used as type annotations. Use 'cython.int' etc. directly.", level=1)
for name, value in annotation.key_value_pairs:
if not name.is_string_literal:
continue
@@ -13689,7 +13689,7 @@ class AnnotationNode(ExprNode):
explicit_ctype = True
annotation = value
if explicit_pytype and explicit_ctype:
- warning(annotation.pos, "Duplicate type declarations found in signature annotation")
+ warning(annotation.pos, "Duplicate type declarations found in signature annotation", level=1)
arg_type = annotation.analyse_as_type(env)
if annotation.is_name and not annotation.cython_attribute and annotation.name in ('int', 'long', 'float'):
# Map builtin numeric Python types to C types in safe cases.