[1.7.x] Fixed #22618 -- Improved import_string example.

Thanks ewjoachim for the sugggestion.

Backport of c501662f3c from master