(The Hill) – The government did not shut down Sunday, surprising just about everyone.

Instead, lawmakers rallied around a 47-day “clean” stopgap measure that did nothing to support Ukraine or deal with the border crisis.

The result is that the House and Senate will have to figure out a way to keep the government open again in a little more than a month if they want to prevent a Thanksgiving shutdown.

They’ll also have to prevent a closure as Speaker Kevin McCarthy (R-Calif.) works under repeated threats to his job.

Here are five takeaways.

McCarthy escapes again — but trouble is around the corner

McCarthy’s ability to surprise — repeatedly snatching a semblance of political victory from the jaws of defeat — is becoming something to behold.

Throughout last week, it seemed certain that the government would close and that he would get the blame.

That this didn’t happen made it a pretty good outcome for the Speaker, even though Democrats got much of what they wanted from the new funding law.

The Speaker’s reward will be continued attacks from Rep. Matt Gaetz (R-Fla.), who on Sunday promised he will bring a motion this week to vacate the chair against McCarthy. This is essentially a motion to toss McCarthy as House Speaker.

“I do intend to file a motion to vacate against Speaker McCarthy this week. I think we need to rip off the Band-Aid. I think we need to move on with leadership that’s trustworthy,” Gaetz said Sunday.

It’s unclear whether McCarthy can survive the vote. Rep. Byron Donalds (R-Fla.) told Fox News that the Speaker is “in trouble,” and Gaetz insisted he had enough votes to unseat him — unless Democrats ride to his rescue.

McCarthy brushed off the trouble, saying Gaetz should “bring it” and that it was a “personal” thing with the Florida lawmaker.

It’s clear McCarthy can’t bend the GOP conference to his will, but it’s questionable whether anyone could.

Democrats on Sunday said it was clear he’d lost control of the GOP conference.

The next week is likely to be juicy for fans of House procedure and political chess matches.

House Democrats have a choice to make

Democrats basically won the weekend shutdown fight, even as they largely watched the GOP’s internal battles as bystanders.

Still, you couldn’t blame them if they didn’t feel like winners, considering that while the shutdown was avoided, it came at the price of aid to Ukraine, a top priority for Democratic leaders and the Biden administration.

Now the big decision for Rep. Hakeem Jeffries (N.Y.), the Democratic leader in the House, is how to handle the unfolding McCarthy vs. Gaetz mess.

Democrats have some leverage. McCarthy can only afford a handful of GOP defections and hang on to his job if Democrats vote to unseat him.

Rep. Alexandria Ocasio-Cortez (D-N.Y.) on Sunday said they should use it. “It comes at a price, you don’t just vote for a Republican Speaker for nothing,” she told CNN’s Jake Tapper.

McCarthy in an interview on CBS’s “Face the Nation” said he had no idea what Jeffries and Democrats would do, while former Speaker Nancy Pelosi (D-Calif.) dodged questions on how she’d vote, urging the caucus to follow the lead of Jeffries.

Democrats got most of what they wanted in terms of a clean continuing resolution (CR) because they ended up being the ones who provided the majority of the House “yes” votes.

They will want some more gifts if McCarthy can’t get out of his GOP jam on his own.

Putin won a victory, and Ukraine pressure will grow

The fact that Congress passed a stopgap funding measure by stripping Ukraine aid at the last minute is undoubtedly a victory for Russian President Vladimir Putin.

That Congress did so a week after Ukrainian President Volodymyr Zelensky’s visit to Washington, where he asked for additional help, just magnifies the win for Russia and Putin.

This week’s shutdown drama has given momentum to the forces in Washington that want to end U.S. support for Ukraine, with increasing numbers of House GOP lawmakers voting against support for Ukraine and Sen. Rand Paul (R-Ky.) holding up a package in the Senate and forcing Minority Leader Mitch McConnell (R-Ky.), a fierce advocate for Ukraine, to retreat.

This will lead to new pressure to take action on Ukraine.

The Biden administration is vowing to dig in on the fight, and pro-Ukraine Republicans such as McConnell and Sen. Lindsey Graham (R-S.C.) also vow support from the U.S. Congress will continue.

Border issues will grow as a shutdown issue

McCarthy insisted Sunday that he wants to provide aid to Ukraine. But he also went out of his way to say securing the border is his priority.

The GOP Speaker secured his shutdown victory with a surprise move to bring to the floor a “clean” CR that included no spending cuts — but also no money for Ukraine.

That effectively dared Democrats to vote against a CR they’d largely support just because of the loss of Ukraine funding. This would have led to Republicans arguing that Democrats had sided with Ukraine over America — and ending a shutdown.

The next GOP argument is likely to be that a measure to secure the border must be a part of a new measure to fund the government, and that any effort to address Ukraine first would be putting that country’s needs over America’s.

It’s a potentially dangerous political argument for Biden and Democrats given polls that suggest some U.S. voter fatigue with support for the war in Ukraine.

McCarthy wasn’t subtle in setting the stage Sunday.

“The priority for me is America and our borders,” McCarthy said when pressed during an interview on CBS’s “Face the Nation” with Margaret Brennan about Ukraine. “Now, I support being able to make sure Ukraine has the weapons that they need, but I firmly support the border first. So we’ve got to find a way that we can do this together.”

Thanksgiving is in jeopardy

Yes, Thanksgiving will take place, but with a new shutdown deadline of Nov. 17, lawmakers are on the clock if they want to go home and spend the holiday with their families while keeping the government open.

Nov. 17 is the Friday before Thanksgiving, and leaders likely decided on that date to put pressure on their rank and file.

The events over the weekend showed that predictions of an inevitable shutdown were wrong and that congressional leaders and lawmakers are full of surprises.

But they also suggest getting a deal in November will be highly difficult. That funding for the border and Ukraine — two incredibly divisive issues — are likely to be in the mix will just make it tougher.

Christmas will be just around the corner. Don’t be surprised if Congress punts a new deadline to that holiday in November.