Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ac0121

Browse files
committed
Run 2to3's fix_has_key over distutils.
1 parent 0470689 commit 2ac0121

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/distutils/command/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def dump_dirs(self, msg):
347347
opt_name = opt[0]
348348
if opt_name[-1] == "=":
349349
opt_name = opt_name[0:-1]
350-
if self.negative_opt.has_key(opt_name):
350+
if opt_name in self.negative_opt:
351351
opt_name = longopt_xlate(self.negative_opt[opt_name])
352352
val = not getattr(self, opt_name)
353353
else:

Lib/distutils/command/register.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def send_metadata(self):
125125
# see if we can short-cut and get the username/password from the
126126
# config
127127
config = None
128-
if os.environ.has_key('HOME'):
128+
if 'HOME' in os.environ:
129129
rc = os.path.join(os.environ['HOME'], '.pypirc')
130130
if os.path.exists(rc):
131131
print('Using PyPI login from %s'%rc)
@@ -168,7 +168,7 @@ def send_metadata(self):
168168
print('Server response (%s): %s'%(code, result))
169169

170170
# possibly save the login
171-
if os.environ.has_key('HOME') and config is None and code == 200:
171+
if 'HOME' in os.environ and config is None and code == 200:
172172
rc = os.path.join(os.environ['HOME'], '.pypirc')
173173
print('I can store your PyPI login so future submissions will be faster.')
174174
print('(the login will be stored in %s)'%rc)

Lib/distutils/command/upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def finalize_options(self):
4545
raise DistutilsOptionError(
4646
"Must use --sign for --identity to have meaning"
4747
)
48-
if os.environ.has_key('HOME'):
48+
if 'HOME' in os.environ:
4949
rc = os.path.join(os.environ['HOME'], '.pypirc')
5050
if os.path.exists(rc):
5151
self.announce('Using PyPI login from %s' % rc)

0 commit comments

Comments
 (0)