@@ -443,7 +443,7 @@ def _get_configdir():
443443def _get_data_path ():
444444 'get the path to matplotlib data'
445445
446- if os . environ . has_key ( 'MATPLOTLIBDATA' ) :
446+ if 'MATPLOTLIBDATA' in os . environ :
447447 path = os .environ ['MATPLOTLIBDATA' ]
448448 if not os .path .isdir (path ):
449449 raise RuntimeError ('Path in environment MATPLOTLIBDATA not a directory' )
@@ -535,7 +535,7 @@ def matplotlib_fname():
535535 fname = os .path .join ( os .getcwd (), 'matplotlibrc' )
536536 if os .path .exists (fname ): return fname
537537
538- if os . environ . has_key ( 'MATPLOTLIBRC' ) :
538+ if 'MATPLOTLIBRC' in os . environ :
539539 path = os .environ ['MATPLOTLIBRC' ]
540540 if os .path .exists (path ):
541541 fname = os .path .join (path , 'matplotlibrc' )
@@ -637,7 +637,7 @@ def rc_params(fail_on_error=False):
637637 verbose .set_fileo (ret ['verbose.fileo' ])
638638
639639 for key , (val , line , cnt ) in rc_temp .iteritems ():
640- if defaultParams . has_key ( key ) :
640+ if key in defaultParams :
641641 if fail_on_error :
642642 ret [key ] = val # try to convert to proper type or raise
643643 else :
@@ -745,7 +745,7 @@ def rc(group, **kwargs):
745745 for k ,v in kwargs .items ():
746746 name = aliases .get (k ) or k
747747 key = '%s.%s' % (g , name )
748- if not rcParams . has_key ( key ) :
748+ if key not in rcParams :
749749 raise KeyError ('Unrecognized key "%s" for group "%s" and name "%s"' %
750750 (key , g , name ))
751751
0 commit comments