Skip to content
Snippets Groups Projects
Commit d4a1b476 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Merge branch 'feature/remove-harmful-local-imports' into 'master'

Remove local imports of warn

There is a module-level import of warn. If you actually trigger
a warning with the current state you, get an UnboundLocalError
because you reference warn before assignment...

See merge request !4
parents 1d1317ed 7f0928c5
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,6 @@ class InstructionBase(Record):
from pymbolic.primitives import LogicalNot
from loopy.symbolic import parse
if pred.startswith("!"):
from warnings import warn
warn("predicates starting with '!' are deprecated. "
"Simply use 'not' instead")
pred = LogicalNot(parse(pred[1:]))
......@@ -405,14 +404,12 @@ class InstructionBase(Record):
def copy(self, **kwargs):
if "insn_deps" in kwargs:
from warnings import warn
warn("insn_deps is deprecated, use depends_on",
DeprecationWarning, stacklevel=2)
kwargs["depends_on"] = kwargs.pop("insn_deps")
if "insn_deps_is_final" in kwargs:
from warnings import warn
warn("insn_deps_is_final is deprecated, use depends_on",
DeprecationWarning, stacklevel=2)
......@@ -831,7 +828,6 @@ class Assignment(MultiAssignmentBase):
class ExpressionInstruction(Assignment):
def __init__(self, *args, **kwargs):
from warnings import warn
warn("ExpressionInstruction is deprecated. Use Assignment instead",
DeprecationWarning, stacklevel=2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment