Trick or treat? That’s the question Parliament will have to ask after the EU threw Theresa May a lifeline late yesterday. Despite signals from Emmanuel Macron that France would veto any further Brexit extension, the EU unanimously agreed to extend the Article 50 deadline date six months, with a new date of October 31st.

That’s a treat … with one big catch:

European Union leaders and British Prime Minister Theresa May agreed Wednesday to a six-month extension on Britain’s deadline to withdraw from the bloc, EU Council President Donald Tush announced.

Tusk said the EU and May agreed on a “flexible extension” until Oct. 31.

“This means additional six months for the U.K. to find the best possible solution,” he tweeted.

During a news conference after announcing the agreement, Tusk said the extension can be ended early if British lawmakers pass a Brexit agreement before October.

“Until the end of this period, the U.K. will also have the possibility to revoke Article 50 and cancel Brexit altogether,” he said.

What’s the catch? The EU will hold its elections on May 23rd, and it expects all member states to participate. If the UK does not approve the Withdrawal Agreement May negotiated over two-plus years with the EU by May 22nd, then the UK will have to hold EU elections. May tried dancing around that point in a statement after the extension agreement, but it still depends on Parliament accepting a deal they have already rejected three times in the past:

Yesterday, the British government began taking steps to prepare for the EU elections. That has May’s Tories furious, and might resurrect the UK Independence Party:

The pro-Brexit U.K. Independence Party, a key driving force behind the vote to leave the EU in 2016, said Thursday it will fight for every seat in the European elections. The party — which won the most seats in the 2014 European election — has raised 500,000 pounds ($654,000) to send leaflets to 27 million households, it said in a statement.

UKIP isn’t the force it was 5 years ago, having gone through a succession of leaders since Nigel Farage stepped down following the 2016 plebiscite. Farage eventually quit the party last year, complaining about current leader Gerard Batten’s obsession with Islam and his association with former English Defence League leader Stephen Yaxley-Lennon, known as Tommy Robinson.

Just seven of the 24 MEPs elected on the UKIP ticket in 2014 remain in the party, with eight now forming part of Farage’s new vehicle, the Brexit Party, and others becoming independents. Farage is due to speak at the launch of the Brexit Party’s European election campaign on Friday.

Pro-Brexit Tories like Jacob Rees-Mogg tried to discourage EU officials from offering an extension by threatening to disrupt the EU if forced to hold elections in the UK. The Brits would become “perfidious Albion on speed” in the next EU parliament, Mark Francois remarked yesterday:

The ERG deputy Mark Francois also warned the EU would be facing “a perfidious Albion on speed” if the UK was “kept in the EU against its will”.

He said: “We will become a Trojan Horse within the EU which would utterly derail all your attempts to pursue a more federal project.

“A new Tory Government led by someone like Boris or Dominic Raab might well vote down your budget, veto your plans for closer military integration and generally make it more difficult for you to bring about the more federal project you so desperately believe in. “

And when the Dutch Mark Rutte explained the EU was relying on “assurances from UK on sincere cooperation” as it “is in all our interest to have an orderly Brexit” Mr Rees-Mogg replied with some cold hard UK Westminster realities.

He tweeted: “Parliament cannot bind its successors, the Prime Minister’s promises have not invariably proved reliable and there has been little sincerity from the EU.”

An extension until October is the least worst of both worlds, maybe. The EU gets six more months to prepare for a crash-out, and pro-Brexit MEPs will only get a few months of “perfidious Albion” agitation. May can use the time to harness that anger toward either passage of her Withdrawal Agreement or perhaps the UK can hold new elections that will dramatically change the Brexit arc. The EU probably hopes for the latter as a best-case scenario with a customs union at the other end of it, or perhaps a rescission of Brexit altogether.

First, though, Parliament has to pass the extension [see update below]. Article 50 is law on both sides of the English Channel, so both the EU and the UK have to approve any changes to it. The mood in Parliament was notably sour, with calls for May’s resignation. They will likely have little choice but to ratify the extension, but until Parliament can agree on anything else about Brexit, we’re looking at simply putting off the inevitable.

If it does pass, though, what comes next will be the EU elections, and perhaps followed quickly by new national elections in the UK. The six-month window now makes a national election with Brexit as the issue possible. Parliament has wrapped up its debate for today, but nerves and alliances are fraying. May’s majority coalition depends on the ten seats from Northern Ireland’s DUP, but this exchange shows an animosity developing between the political allies and May’s own sour mood from dealing with critics from within the coalition.

Update: The previous extension had two deadlines: tomorrow if Parliament didn’t pass the Withdrawal Agreement, and May 22nd if they did. The first deadline would have prompted action from the EU but since they have waived that action, the May 22nd deadline is likely the only one to have legal force, so Parliament may not need to pass the extension until then.