MAINT: remove two redundant lines of code

closes https://github.com/scipy/scipy/issues/4222