@@ -122,7 +122,7 @@ def validate(self, *args, **kwargs):
122122 try :
123123 validation_errors = self ._validate (* args , ** kwargs )
124124 errors .extend (validation_errors )
125- except Exception , e :
125+ except Exception as e :
126126 emsg = repr (e )
127127 msg = u'Error validating field %(name)s: %(value)r: %(emsg)r'
128128 errors .append (Error (CRITICAL , msg % locals ()))
@@ -496,7 +496,7 @@ def _validate(self, *args, **kwargs):
496496 location = add_unc (location )
497497 text = codecs .open (location , encoding = 'utf-8' , errors = 'ignore' ).read ()
498498 self .value [path ] = text
499- except Exception , e :
499+ except Exception as e :
500500 # only keep the first 100 char of the exception
501501 emsg = repr (e )[:100 ]
502502 msg = (u'Field %(name)s: Failed to load text at path: '
@@ -949,7 +949,7 @@ def load(self, location):
949949 running_inventory = True
950950 errs = self .load_dict (saneyaml .load (input_text ), base_dir , running_inventory )
951951 errors .extend (errs )
952- except Exception , e :
952+ except Exception as e :
953953 msg = 'Cannot load invalid ABOUT file: %(location)r: %(e)r\n ' + str (e )
954954 errors .append (Error (CRITICAL , msg % locals ()))
955955
@@ -1430,7 +1430,7 @@ def valid_api_url(api_url):
14301430 # This will always goes to exception as no key are provided.
14311431 # The purpose of this code is to validate the provided api_url is correct
14321432 response = urllib2 .urlopen (request )
1433- except urllib2 .HTTPError , http_e :
1433+ except urllib2 .HTTPError as http_e :
14341434 # The 403 error code is refer to "Authentication credentials were not provided.".
14351435 # This is correct as no key are provided.
14361436 if http_e .code == 403 :
0 commit comments