[Python] Fix bug with variable extention

Authored by sirgienko on Aug 5 2019, 4:19 PM.