@contextmanager
    def handle_popup(self, trigger):
        initial_window_handle = self.selenium.current_window_handle
        window_handles = set(self.selenium.window_handles)
        try:
            trigger()
            self.wait_until(lambda driver: set(driver.window_handles) != window_handles)
            new_window_handle = (window_handles - set(self.selenium.window_handles)).pop()
            self.selenium.switch_to.window(new_window_handle)
            yield new_window_handle
        finally:
            time.sleep(1)
            self.selenium.switch_to.window(initial_window_handle)
dataset/ETHPy150Open charettes/django-admin-enhancer/tests/tests.py/InteractionTest.handle_popup/swapped operands of `-`