PARIS — European countries from Poland to Italy and Britain are shutting borders, stepping up deportations and making unsavory deals with warlords in Libya to restrict migrants. Now comes France’s turn.

The government of President Emmanuel Macron this week put forward a draft law that even some of his own supporters said was too harsh. Human rights groups say it is intended to make it easier to expel would-be asylum seekers.

But in presenting the proposal this week, Mr. Macron’s interior minister, Gerard Collomb, made no bones about its other aim: to head off the political challenge of the far right.

The migrant issue “is a problem that can lead to difficulties” — meaning political difficulties — he told reporters on Wednesday, before getting into the details of the law.