Fix python error.

Ticket: #6419