line 163, os is not defined

Hi,

I changed the position of the os import for line 163. I have some trouble while running unittests with python3 on my machine. I'm trying to fix them.