* Sterling’s gains mostly thanks to falling dollar
* Peterborough by-election little boost for the pound
* Graphic: World FX rates in 2019 tmsnrt.rs/2egbfVh
* Graphic: Trade-weighted sterling since Brexit vote tmsnrt.rs/2hwV9Hv
LONDON, June 7 (Reuters) - Sterling was on course for its first weekly gain in five on Friday, helped mostly by a weakening dollar rather than because traders feel more confident that Britain can avoid a no-deal Brexit.
Investors have shied away from making big bets on the pound in recent weeks as a leadership contest to take over from Theresa May as prime minister and Conservative party leader gets under way.
Boris Johnson, who campaigned to leave the European Union in the 2016 referendum, is favourite to win, worrying investors that he could set Britain on a course towards leaving the bloc without a deal.
That would send sterling hurtling lower, but this week the pound has managed to recover from five-month lows thanks to a dollar weakened by the prospect of Federal Reserve interest rate cuts.
The opposition Labour party beat off the insurgent Brexit party - which has sought to seize on anger with mainstream parties by pushing for a no-deal Brexit - in a by-election to retain its Peterborough eastern England constituency overnight, although analysts said with the ruling Conservatives coming in third it would not improve sentiment towards the pound by much.
“The margin was, however, extremely narrow (700 votes) and the Conservatives were a fairly distant third, so we don’t expect GBP to find much relief from the recent rise in political risk premia,” said Adam Cole, strategist at RBC Capital Markets.
Sterling rose 0.2% to $1.2710, leaving it up 0.6% and snapping four consecutive weeks of losses.
Against the euro the British currency has struggled, too, and failed to make much of a recovery this week.
However, it rose 0.3% to 88.595 pence per euro on Friday, after the euro slipped back across the board. On Thursday, the euro had rallied after the European Central Bank sounded less dovish about monetary policy and the economic outlook than expected. (Reporting by Tommy Wilkes Editing by Keith Weir)