From 56aea2672000174743514bcc7f58f41733f64ce4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 1 Jul 2008 12:53:07 +0000 Subject: Py3k compatibility patch #5 by Ali Polatel . Replace dict.has_key() calls with "in" and "not in" operators. svn path=/main/trunk/; revision=10874 --- bin/dispatch-conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/dispatch-conf') diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 8ae055565..07131b55e 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -72,7 +72,7 @@ class dispatch: self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS) - if self.options.has_key("log-file"): + if "log-file" in self.options: if os.path.isfile(self.options["log-file"]): shutil.copy(self.options["log-file"], self.options["log-file"] + '.old') if os.path.isfile(self.options["log-file"]) \ @@ -270,7 +270,7 @@ class dispatch: show_new_diff = 1 continue elif c == 'e': - if not os.environ.has_key('EDITOR'): + if 'EDITOR' not in os.environ: os.environ['EDITOR']='nano' os.system(os.environ['EDITOR'] + ' ' + newconf) continue @@ -334,7 +334,7 @@ class dispatch: conf = re.sub (r'\._cfg\d+_', '', nconf) dir = re.match (r'^(.+)/', nconf).group (1) - if h.has_key (conf): + if conf in h: mrgconf = re.sub(r'\._cfg', '._mrg', h[conf]['new']) if os.path.exists(mrgconf): os.unlink(mrgconf) -- cgit v1.2.3-1-g7c22