hdl: remove deprecated get_fragment() and lower() methods.
authorwhitequark <cz@m-labs.hk>
Tue, 9 Apr 2019 23:53:43 +0000 (23:53 +0000)
committerwhitequark <cz@m-labs.hk>
Tue, 9 Apr 2019 23:53:43 +0000 (23:53 +0000)
nmigen/hdl/dsl.py
nmigen/hdl/ir.py

index 854fa07fc6fa643836ad942939f6b118deaca313..95f6eb04293d662b8c73af12f7daff3a9a84483b 100644 (file)
@@ -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()
 
index d799648b9fbad7f0ff3b5adaf44eb1c2dd11bb09..50b23d0167ee751884470e5907d98c84b59961ad 100644 (file)
@@ -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)