diff --git a/scipy/optimize/_dcsrch.py b/scipy/optimize/_dcsrch.py index 5223e33718cf..4931f36c702d 100644 --- a/scipy/optimize/_dcsrch.py +++ b/scipy/optimize/_dcsrch.py @@ -367,8 +367,8 @@ def _iterate(self, stp, f, g, task): task = b"FG" return stp, f, g, task - else: - pass + # in the original Fortran this was a location to restore variables + # we don't need to do that because they're attributes. # If psi(stp) <= 0 and f'(stp) >= 0 for some step, then the # algorithm enters the second stage.