After ignoring Warsaw during his first term, David Cameron rushed to Poland immediately after his re-election in May, hoping to get the country on board his renegotiation package.
But the ruling Civic Platform party, in power for the last eight years, now looks set for defeat. Law and Justice, the party leading in the opinion polls, may prove a tough negotiating partner in the European Council despite belonging to the same political group as the Tories in the European Parliament.
So what would Warsaw's position be on the five central issues in Cameron's renegotiation after the election?
Whoever wins on October 25th there would certainly be support in Poland for the first reform area: making the EU more competitive by cutting red tape and further liberalising the single market. The country is a clear beneficiary of the single market (between 2004 and 2013 its exports to the rest of the EU grew by almost three-fold, to reach a value of €114 billion in 2013).
But the Law and Justice party's sympathy for deregulation does not mean it believes in Adam Smith's 'invisible hand' in all circumstances. It has promised to impose a special tax on large retail companies, many of which are foreign owned.
Second, Cameron wants to obtain an opt-out from the objective of 'ever closer union' set out in the Treaty on European Union. If Cameron were to demand a Treaty change, rather than a softening of the wording, he may find a more sympathetic ally in Law and Justice than in Civic Platform. But the risk is that the party may use discussions on 'ever closer union' to argue for its own opt-outs. Its representatives have already hinted they would attempt to secure exemptions from the EU's climate policy. If the party decides to use Cameron's reform agenda to unpick what it does not like about the European project, other EU capitals will follow suit, delaying the renegotiation process.
Third, Cameron thinks that national parliaments should have a greater say in EU decision-making. Both parties would understand these concerns and might agree to a strengthening of the 'yellow card' procedure. But they would both stop short of collective veto rights for national parliaments as this would cause the EU's institutional order to break down.
On Cameron's demand of 'safeguards' for the single market for countries outside the eurozone, the two parties have completely different views. Civic Platform wants Poland to join the euro once it meets the convergence criteria and once the economic turmoil in the eurozone is over. So the current Polish government has been more interested in participating in eurozone deliberations and its decision-making than in securing safeguards for 'euro-outs'.
In contrast, Law and Justice's prime ministerial candidate Beata Szydło has indicated that she would put off any discussion of adopting the euro until the wages of Poles were similar to those of their Western European colleagues. Her mistrust of the euro makes her a natural ally of Cameron's.
Finally, Cameron wants to limit access to unemployment and in-work benefits for EU citizens for the first four years after their arrival in the UK. Poles are the largest group of EU migrants living in the UK (Poles constituted 8.7per cent of all foreign citizens in Britain in 2013). As the elections near, both parties are likely to harden their stance on Cameron's free movement demands. In 2014, 80,000 Poles living in the UK registered to vote in the Polish presidential elections. This is not an enormous number, but if the parties are neck-and-neck, these votes will matter.
But Warsaw's opposition to Cameron's ideas is not merely a political calculation. He should realise that Poles see free movement of people as one of Europe's greatest achievements, not a problem. The country was separated from Western Europe by the Iron Curtain for too long to sympathise with ideas putting freedom of movement at risk.
If Cameron, on the other hand, can focus on improving the EU for everyone, whether in Western or Central Europe, he may be able to get the support he needs from Warsaw, no matter which party forms the next government.