Fix for attempted print to sys.stderr when sys had not been imported