Enable -deprecation flag to catch old code being use when we migrate things. In this commit I moved error to sys.error.