Senior House and Senate leaders voiced optimism that they could reach agreement on a stopgap spending measure that would prevent a government shutdown shortly before the November election.

Congress has more than two months to figure out how to fund the government this fall, but because lawmakers are only in session for less than three weeks during that time, discussions about a continuing resolution have heated up in recent days. The Senate has made little progress passing annual appropriations bills, necessitating a stopgap measure to keep the government’s lights on through the November election.