mirror of https://github.com/pypa/pip
Fix new lint errors from newer flake8
This commit is contained in:
parent
cc720b76ef
commit
c92d13e9d3
|
@ -240,7 +240,7 @@ class Command(object):
|
||||||
logger.debug('Exception information:', exc_info=True)
|
logger.debug('Exception information:', exc_info=True)
|
||||||
|
|
||||||
return ERROR
|
return ERROR
|
||||||
except:
|
except Exception:
|
||||||
logger.critical('Exception:', exc_info=True)
|
logger.critical('Exception:', exc_info=True)
|
||||||
|
|
||||||
return UNKNOWN_ERROR
|
return UNKNOWN_ERROR
|
||||||
|
|
|
@ -217,7 +217,7 @@ else:
|
||||||
'hh',
|
'hh',
|
||||||
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
|
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
|
||||||
)
|
)
|
||||||
except:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
if cr == (0, 0):
|
if cr == (0, 0):
|
||||||
return None
|
return None
|
||||||
|
@ -228,7 +228,7 @@ else:
|
||||||
fd = os.open(os.ctermid(), os.O_RDONLY)
|
fd = os.open(os.ctermid(), os.O_RDONLY)
|
||||||
cr = ioctl_GWINSZ(fd)
|
cr = ioctl_GWINSZ(fd)
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
if not cr:
|
if not cr:
|
||||||
cr = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80))
|
cr = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80))
|
||||||
|
|
|
@ -48,7 +48,7 @@ def install_given_reqs(to_install, install_options, global_options=(),
|
||||||
*args,
|
*args,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
except:
|
except Exception:
|
||||||
should_rollback = (
|
should_rollback = (
|
||||||
requirement.conflicts_with and
|
requirement.conflicts_with and
|
||||||
not requirement.install_succeeded
|
not requirement.install_succeeded
|
||||||
|
|
|
@ -506,8 +506,8 @@ if __name__ == '__main__':
|
||||||
row[1], row[2] = rehash(row[0])
|
row[1], row[2] = rehash(row[0])
|
||||||
writer.writerow(row)
|
writer.writerow(row)
|
||||||
for f in generated:
|
for f in generated:
|
||||||
h, l = rehash(f)
|
digest, length = rehash(f)
|
||||||
writer.writerow((normpath(f, lib_dir), h, l))
|
writer.writerow((normpath(f, lib_dir), digest, length))
|
||||||
for f in installed:
|
for f in installed:
|
||||||
writer.writerow((installed[f], '', ''))
|
writer.writerow((installed[f], '', ''))
|
||||||
shutil.move(temp_record, record)
|
shutil.move(temp_record, record)
|
||||||
|
@ -528,7 +528,7 @@ def wheel_version(source_dir):
|
||||||
version = wheel_data['Wheel-Version'].strip()
|
version = wheel_data['Wheel-Version'].strip()
|
||||||
version = tuple(map(int, version.split('.')))
|
version = tuple(map(int, version.split('.')))
|
||||||
return version
|
return version
|
||||||
except:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ class WheelBuilder(object):
|
||||||
)
|
)
|
||||||
logger.info('Stored in directory: %s', output_dir)
|
logger.info('Stored in directory: %s', output_dir)
|
||||||
return wheel_path
|
return wheel_path
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
# Ignore return, we can't do anything else useful.
|
# Ignore return, we can't do anything else useful.
|
||||||
self._clean_one(req)
|
self._clean_one(req)
|
||||||
|
@ -685,7 +685,7 @@ class WheelBuilder(object):
|
||||||
call_subprocess(wheel_args, cwd=req.setup_py_dir,
|
call_subprocess(wheel_args, cwd=req.setup_py_dir,
|
||||||
show_stdout=False, spinner=spinner)
|
show_stdout=False, spinner=spinner)
|
||||||
return True
|
return True
|
||||||
except:
|
except Exception:
|
||||||
spinner.finish("error")
|
spinner.finish("error")
|
||||||
logger.error('Failed building wheel for %s', req.name)
|
logger.error('Failed building wheel for %s', req.name)
|
||||||
return False
|
return False
|
||||||
|
@ -698,7 +698,7 @@ class WheelBuilder(object):
|
||||||
try:
|
try:
|
||||||
call_subprocess(clean_args, cwd=req.source_dir, show_stdout=False)
|
call_subprocess(clean_args, cwd=req.source_dir, show_stdout=False)
|
||||||
return True
|
return True
|
||||||
except:
|
except Exception:
|
||||||
logger.error('Failed cleaning build dir for %s', req.name)
|
logger.error('Failed cleaning build dir for %s', req.name)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -639,7 +639,7 @@ class TestParseRequirements(object):
|
||||||
popen.return_value.stdout.readline.return_value = b""
|
popen.return_value.stdout.readline.return_value = b""
|
||||||
try:
|
try:
|
||||||
req.install([])
|
req.install([])
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
last_call = popen.call_args_list[-1]
|
last_call = popen.call_args_list[-1]
|
||||||
|
|
|
@ -121,12 +121,12 @@ class TestUninstallPathSet(object):
|
||||||
f = os.path.join(tmpdir, 'foo')
|
f = os.path.join(tmpdir, 'foo')
|
||||||
with open(f, 'w'):
|
with open(f, 'w'):
|
||||||
pass
|
pass
|
||||||
l = os.path.join(tmpdir, 'foo_link')
|
foo_link = os.path.join(tmpdir, 'foo_link')
|
||||||
os.symlink(f, l)
|
os.symlink(f, foo_link)
|
||||||
|
|
||||||
ups = UninstallPathSet(dist=Mock())
|
ups = UninstallPathSet(dist=Mock())
|
||||||
ups.add(l)
|
ups.add(foo_link)
|
||||||
assert ups.paths == {l}
|
assert ups.paths == {foo_link}
|
||||||
|
|
||||||
def test_compact_shorter_path(self, monkeypatch):
|
def test_compact_shorter_path(self, monkeypatch):
|
||||||
monkeypatch.setattr(pip._internal.req.req_uninstall, 'is_local',
|
monkeypatch.setattr(pip._internal.req.req_uninstall, 'is_local',
|
||||||
|
|
Loading…
Reference in New Issue