From de52ab00023d5e7d3aca58c48d88a0b9fe563e71 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 9 Apr 2019 23:53:43 +0000 Subject: [PATCH] hdl: remove deprecated get_fragment() and lower() methods. --- nmigen/hdl/dsl.py | 18 ++---------------- nmigen/hdl/ir.py | 2 -- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/nmigen/hdl/dsl.py b/nmigen/hdl/dsl.py index 854fa07..95f6eb0 100644 --- a/nmigen/hdl/dsl.py +++ b/nmigen/hdl/dsl.py @@ -368,14 +368,8 @@ class Module(_ModuleBuilderRoot): def _add_submodule(self, submodule, name=None): if not hasattr(submodule, "elaborate"): - if hasattr(submodule, "get_fragment"): # :deprecated: - warnings.warn("Adding '{!r}', which implements .get_fragment() but not " - ".elaborate(), as a submodule. .get_fragment() is deprecated, " - "and .elaborate() should be provided instead.".format(submodule), - DeprecationWarning, stacklevel=2) - else: - raise TypeError("Trying to add '{!r}', which does not implement .elaborate(), as " - "a submodule".format(submodule)) + raise TypeError("Trying to add '{!r}', which does not implement .elaborate(), as " + "a submodule".format(submodule)) self._submodules.append((submodule, name)) def _add_domain(self, cd): @@ -385,14 +379,6 @@ class Module(_ModuleBuilderRoot): while self._ctrl_stack: self._pop_ctrl() - @deprecated("`m.get_fragment(...)` is deprecated; use `m` instead") - def get_fragment(self, platform): # :deprecated: - return self.elaborate(platform) - - @deprecated("`m.lower(...)` is deprecated; use `m` instead") - def lower(self, platform): # :deprecated: - return self.elaborate(platform) - def elaborate(self, platform): self._flush() diff --git a/nmigen/hdl/ir.py b/nmigen/hdl/ir.py index d799648..50b23d0 100644 --- a/nmigen/hdl/ir.py +++ b/nmigen/hdl/ir.py @@ -20,8 +20,6 @@ class Fragment: return obj if hasattr(obj, "elaborate"): frag = obj.elaborate(platform) - elif hasattr(obj, "get_fragment"): # :deprecated: - frag = obj.get_fragment(platform) else: raise AttributeError("Object '{!r}' cannot be elaborated".format(obj)) return Fragment.get(frag, platform) -- 2.30.2