Poland has avoided a credit rating downgrade from Moody's, and the latest assessment of its economic policies from the International Monetary Fund is rather mild. Although the nationalist government has drawn a lot of adverse attention lately, it might get away with a version of the financial nationalism that Prime Minister Viktor Orban has implemented in Hungary.

On Saturday, Moody's said it wouldn't follow the example of S&P Global Ratings, which unexpectedly downgraded Poland earlier this year. In its analysis, Moody's pointed out the resilience of Poland's large, diversified economy and predicted growth of 3.5 percent in 2016 and 2017.

The ratings company did put Poland on negative watch, expressing concern about some potentially costly populist moves. These include a child benefit subsidy, only covered by one-time revenue such as those from the sale of telecom licenses this year; plans to lower the retirement age and the minimum taxable income; and a potential crisis in the banking system if the government delivers on its election promises to restructure about 500,000 mortgages denominated in Swiss francs. The latter idea is especially dangerous for Poland's status as a major European destination for foreign investment. The country has already seen big portfolio investment outflows this year, and the zloty has been among the worst-performing emerging-market currencies, losing about 5 percent against the euro since early April (it rebounded after the Moody's decision).

Poland's budget deficit could overshoot the European Union's target of 3 percent, and investors may continue to be spooked by the nationalist rhetoric and the socialist fervor of the governing Law and Justice party, known as PiS. Yet Orban's policies, on which the plans largely appear to be based, have more or less worked in Hungary, and they could work in Poland, too.

Whe he began his program, in 2010, Orban faced a different situation than the PiS government of President Andrzej Duda and Prime Minister Beata Szydlo does in Poland today. The four previous post-Communist governments in Poland had been profligate, never allowing the budget deficit to fall below 4.5 percent of economic output. The government before Orban's kept it well above 6 percent. In three years, Orban cut it down to 2.5 percent, largely by putting into effect new taxes -- on retail trade, electricity and gas distribution, insurance, and, most profitably, banking. Banks have been forced to pay 0.6 percent of their assets, and though six of the seven biggest Hungarian banks were subsidiaries of foreign ones, only one, BayernLB, left, selling its subsidiary to the National Bank of Hungary.

Poland is undertaking or planning similar moves because it wants to be less tight-fisted, not because it's been overspending. Its budget deficit was 2.6 percent last year. And the PiS government is being relatively careful. Its banking levy is lower than Hungary's, at 0.44 percent of assets, and foreign financial institutions, which control 70 percent of the banking system's assets, aren't going anywhere. The tax has already depressed lending somewhat, but that happened in Hungary, too, and economic growth has been healthy, at least in the last three years since a 2012 hiccup. In 2015, the Hungarian economy expanded by 3.2 percent, compared with Poland's 3.6 percent.

The Polish government is still working on the retail tax, which proved problematic for Orban, too -- the European Union objected to a progressive scale, which PiS also proposes. In any case, it will be far lower than Orban's "food chain fee" of up to 6 percent of annual revenue. A couple of smaller retain chains left Hungary because of the harsh treatment, but the U.K.'s Tesco, for example, -- a leading player in Poland, too -- stayed and retained its market leadership.

Poland probably cannot follow in Orban's footsteps in one important area: The Swiss franc mortgages. The Hungarian prime minister forced banks to convert them into forints at the November 2014 market rate -- just before the Swiss National Bank discarded its euro peg in January 2015, and the franc shot up against all other currencies. Orban was praised for the remarkable timing, and the Hungarian banking system swallowed the exchange: Non-performing loans were creeping up to a quarter of the total, and arguing than the loans had been, in effect, missold had become counterproductive.

Poland missed the boat. Converting the loans at rates acceptable to borrowers could spell disaster for the banking sector. Moody's cited a worst-case scenario under which the conversion could cost the banks 3.7 percent of Poland's 2015 gross domestic product or or 4.5 times the whole sector's 2015 pretax profit. "Proposals for blanket conversion of Swiss franc mortgages into zloty, if implemented, risk undermining financial stability, with adverse implications for credit and growth," the IMF warned. "Instead, the focus should be on supporting distressed mortgage holders on a case-by-case basis."

Duda and Szydlo probably won't completely ignore these warnings. According to a recent leak, a "blanket conversion" may not take place. Duda's election promises weren't that specific, and there may be other ways to help borrowers, such as putting the mortgages in a special-purpose vehicle that would issue bonds, allowing banks to avoid a huge one-time asset write-off.

Orban's financial nationalism has largely succeeded, Juliet Johnson of McGill University and Andrew Barnes of Kent State University wrote in a 2015 paper -- in part because the international bond markets have been surprisingly tolerant of the prime minister's illiberal policies. As long as Orban kept the macroeconomic numbers under control, and he did, yield-seeking investors were willing to lend to Hungary, even though the EU and the IMF were grumbling about the growing role of the state in the economy and Orban's readiness to fleece big foreign companies.

It's somewhat harder for the PiS government to resist pressure from the EU: The party is part of a weaker faction in the European Parliament, and under Jean-Claude Juncker, the European Commission is somewhat more interventionist. But then the Poles appear to be less devil-may-care than Orban's Fidesz party. They are walking a thin line, but even the IMF's analysis suggests that not falling off is a viable option.

If PiS succeeds in not ruining the country's finances and manages to fund some important social promises with Orban-like but moderate measures, financial nationalism may gain some legitimacy and perhaps even some appeal outside of Eastern Europe.

This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.