added safety check to __getattr__ and to the PythonCheckSyntaxListener