[Git][reproducible-builds/diffoscope][master] Consolidate on "e" as the aliased exception name.
Chris Lamb
gitlab at salsa.debian.org
Wed Apr 24 10:31:14 CEST 2019
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
39e7b6b8 by Chris Lamb at 2019-04-24T08:30:52Z
Consolidate on "e" as the aliased exception name.
- - - - -
4 changed files:
- diffoscope/comparators/pdf.py
- diffoscope/comparators/utils/libarchive.py
- diffoscope/comparators/zip.py
- diffoscope/diff.py
Changes:
=====================================
diffoscope/comparators/pdf.py
=====================================
@@ -64,8 +64,8 @@ class PdfFile(File):
try:
pdf = PyPDF2.PdfFileReader(file.path)
document_info = pdf.getDocumentInfo()
- except PyPDF2.utils.PdfReadError as exc:
- return "(Could not extract metadata: {})".format(exc)
+ except PyPDF2.utils.PdfReadError as e:
+ return "(Could not extract metadata: {})".format(e)
xs = []
for k, v in sorted(document_info.items()):
=====================================
diffoscope/comparators/utils/libarchive.py
=====================================
@@ -320,8 +320,8 @@ class LibarchiveContainer(Archive):
with open(dst, 'wb') as f:
for block in entry.get_blocks():
f.write(block)
- except Exception as exc:
- raise ContainerExtractionError(entry.pathname, exc)
+ except Exception as e:
+ raise ContainerExtractionError(entry.pathname, e)
logger.debug(
"Extracted %d entries from %s to %s",
=====================================
diffoscope/comparators/zip.py
=====================================
@@ -145,11 +145,11 @@ class ZipContainer(Archive):
) as target:
shutil.copyfileobj(source, target)
return targetpath.decode(sys.getfilesystemencoding())
- except RuntimeError as exc:
+ except RuntimeError as e:
# Handle encrypted files see line 1292 of zipfile.py
is_encrypted = self.archive.getinfo(member_name).flag_bits & 0x1
if is_encrypted:
- raise ContainerExtractionError(member_name, exc)
+ raise ContainerExtractionError(member_name, e)
raise
def get_member(self, member_name):
=====================================
diffoscope/diff.py
=====================================
@@ -223,8 +223,8 @@ class FIFOFeeder(threading.Thread):
while True:
try:
fd = os.open(self.fifo_path, os.O_WRONLY | os.O_NONBLOCK)
- except OSError as error:
- if error.errno != errno.ENXIO:
+ except OSError as e:
+ if e.errno != errno.ENXIO:
raise
elif self._want_join.is_set():
return
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/39e7b6b84e2b14e22ce94b2e0b83563b9e809d99
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/39e7b6b84e2b14e22ce94b2e0b83563b9e809d99
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190424/c489a6e6/attachment.html>
More information about the rb-commits
mailing list