The saying "You are permitted in times of great danger to walk with the devil until you have crossed the bridge" (often rendered as "When in danger, even an enemy becomes a friend") captures a brutal pragmatic truth: survival trumps principle.
In desperate circumstances—war, disaster, life-threatening illness—moral purity is a luxury. Accepting help from a rival, a disliked colleague, or a historical adversary isn't hypocrisy; it's self-preservation. The "devil" represents anyone you'd normally avoid, and the "bridge" is the immediate crisis.
The proverb doesn't advocate abandoning values permanently. It acknowledges a temporary, tactical truce. Once the bridge is crossed—crisis resolved—the alliance may dissolve. The wisdom lies in recognizing the moment when pride must yield to survival, without forgetting who the "devil" truly is.