Add missing sys import

Fixes NameError on line 138.