A warning light pointing towards a potential global recession began to flash this week, just two months before the federal election.

The main stock indexes in Canada and the U.S. had their worst days of the year and the yield-curve inverted -- a tell-tale sign that has reared its head before the last seven recessions. There were only two times that a yield-curve inversion did not precede a recession -- once in 1966, and again in 1988.

A yield curve inversion refers to when the longer-term interest rates in the bond market fall below the shorter term ones -- a symptom of nervous investors losing confidence in the economy's immediate future. The last time it happened was just a year and a half before the 2008 recession.

Should a recession hit before the election, it could have major implications for the parties vying for power this fall.

"Recessions tend to make voters extremely grumpy," said Nanos Research analyst Nik Nanos.

"There are two emotions that are usually at play: anger and fear."

Those emotions impact how politicians pitch themselves to Canadians – a pitch that Nanos says former prime minister Stephen Harper has successfully delivered in the past.

"Stephen Harper … would very successfully [identify] himself as the least risky choice if there was a potential recession," Nanos said.

However, he warned that there's good and bad involved with that pitch, as recession-time voters are often "looking to punish the incumbent."

"It can play itself differently depending on the party and the prime minister of the day... a lot of it has to do with not just how a prime minister responds to a recession but how a prime minister [conveys] that they understand how Canadians feel in terms of their anxiety," Nanos said.

Pollster Shachi Kurl, who serves as Executive Director of the Angus Reid Institute, agreed that a hypothetical recession would lead to "an increase in voter anxiety."

"So how does that anxiety then intersect – if it comes to pass – with the messages we hear particularly from [Prime Minister] Justin Trudeau and [Conservative Leader] Andrew Scheer? It's a bit of a known unknown," she said.

"You're dealing with a lot of hypotheticals."

According to Nanos, Trudeau could be well positioned to campaign during a recession. In a survey Nanos conducted for Bloomberg News, he found that Trudeau had a "noticeable advantage" over Scheer when it comes to Canadians' perception of who is best at managing the economy.

He also warned that the Conservatives will have to be careful not to focus too much on other issues and forget about the economy, as it's "hard to fathom a Conservative government winning an election without being strong on the economy."

Still, a recession would present some opportunities for the Conservatives to attack Trudeau. Nanos said it would create a backdrop for "key battles the parties want to wage war on," such as the carbon tax.

"You can expect that the Conservatives are going to say if a recession occurs, that's not really the right time to have new carbon taxes and to be a big taxing type government," said Nanos.

Still, Kurl warned that it's important not to make assumptions about voters based on hypotheticals. She pointed out that prior to the 2015 election, some interesting polling emerged that pointed to a "fatigue" from Canadians when it came to austerity and belt tightening.

"We found that 70 per cent of Canadians were in favour of seeing a government run some modest deficits in the name of infrastructure spending and job creation," Kurl said.

While she said a recession could impact the upcoming election, there's no point in trying to guess what could happen – or how a party or population will respond – before it actually hits.

"It is a bit of a wait and see," said Kurl.