Fix new lint errors from newer flake8

This commit is contained in:
Pradyun Gedam 2018-06-25 17:21:41 +05:30
parent cc720b76ef
commit c92d13e9d3
No known key found for this signature in database
GPG Key ID: DA17C4B29CB32E4B
6 changed files with 15 additions and 15 deletions

View File

@ -240,7 +240,7 @@ class Command(object):
logger.debug('Exception information:', exc_info=True)
return ERROR
except:
except Exception:
logger.critical('Exception:', exc_info=True)
return UNKNOWN_ERROR

View File

@ -217,7 +217,7 @@ else:
'hh',
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
)
except:
except Exception:
return None
if cr == (0, 0):
return None
@ -228,7 +228,7 @@ else:
fd = os.open(os.ctermid(), os.O_RDONLY)
cr = ioctl_GWINSZ(fd)
os.close(fd)
except:
except Exception:
pass
if not cr:
cr = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80))

View File

@ -48,7 +48,7 @@ def install_given_reqs(to_install, install_options, global_options=(),
*args,
**kwargs
)
except:
except Exception:
should_rollback = (
requirement.conflicts_with and
not requirement.install_succeeded

View File

@ -506,8 +506,8 @@ if __name__ == '__main__':
row[1], row[2] = rehash(row[0])
writer.writerow(row)
for f in generated:
h, l = rehash(f)
writer.writerow((normpath(f, lib_dir), h, l))
digest, length = rehash(f)
writer.writerow((normpath(f, lib_dir), digest, length))
for f in installed:
writer.writerow((installed[f], '', ''))
shutil.move(temp_record, record)
@ -528,7 +528,7 @@ def wheel_version(source_dir):
version = wheel_data['Wheel-Version'].strip()
version = tuple(map(int, version.split('.')))
return version
except:
except Exception:
return False
@ -653,7 +653,7 @@ class WheelBuilder(object):
)
logger.info('Stored in directory: %s', output_dir)
return wheel_path
except:
except Exception:
pass
# Ignore return, we can't do anything else useful.
self._clean_one(req)
@ -685,7 +685,7 @@ class WheelBuilder(object):
call_subprocess(wheel_args, cwd=req.setup_py_dir,
show_stdout=False, spinner=spinner)
return True
except:
except Exception:
spinner.finish("error")
logger.error('Failed building wheel for %s', req.name)
return False
@ -698,7 +698,7 @@ class WheelBuilder(object):
try:
call_subprocess(clean_args, cwd=req.source_dir, show_stdout=False)
return True
except:
except Exception:
logger.error('Failed cleaning build dir for %s', req.name)
return False

View File

@ -639,7 +639,7 @@ class TestParseRequirements(object):
popen.return_value.stdout.readline.return_value = b""
try:
req.install([])
except:
except Exception:
pass
last_call = popen.call_args_list[-1]

View File

@ -121,12 +121,12 @@ class TestUninstallPathSet(object):
f = os.path.join(tmpdir, 'foo')
with open(f, 'w'):
pass
l = os.path.join(tmpdir, 'foo_link')
os.symlink(f, l)
foo_link = os.path.join(tmpdir, 'foo_link')
os.symlink(f, foo_link)
ups = UninstallPathSet(dist=Mock())
ups.add(l)
assert ups.paths == {l}
ups.add(foo_link)
assert ups.paths == {foo_link}
def test_compact_shorter_path(self, monkeypatch):
monkeypatch.setattr(pip._internal.req.req_uninstall, 'is_local',