[PATCH 1 of 6 eac] [flake8] Fix F841 local variable 'exc' is assigned to but never used

Denis Laxalde denis.laxalde at logilab.fr
Tue Oct 30 11:14:53 CET 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1540891440 -3600
#      Tue Oct 30 10:24:00 2018 +0100
# Node ID dd1de190b78f8e9ccdabaaf139b4b2b8fc8cf707
# Parent  26d6b359607db70050569acd517f6105ed35f773
# Available At http://hg.logilab.org/review/cubes/eac
#              hg pull http://hg.logilab.org/review/cubes/eac -r dd1de190b78f
[flake8] Fix F841 local variable 'exc' is assigned to but never used

diff --git a/cubicweb_eac/dataimport.py b/cubicweb_eac/dataimport.py
--- a/cubicweb_eac/dataimport.py
+++ b/cubicweb_eac/dataimport.py
@@ -709,7 +709,7 @@ class EACCPFImporter(object):
         default = datetime.datetime(9999, 1, 1)
         try:
             pdate = parse_date(date, default=default)
-        except ValueError as exc:
+        except ValueError:
             record_warning(self._('could not parse date %(e)s'))
             return None
         except Exception as exc:  # pylint: disable=broad-except
diff --git a/cubicweb_eac/sobjects.py b/cubicweb_eac/sobjects.py
--- a/cubicweb_eac/sobjects.py
+++ b/cubicweb_eac/sobjects.py
@@ -46,7 +46,7 @@ class EACImportService(Service):
         try:
             created, updated, record_eid, not_visited = self.import_eac_stream(
                 stream, import_log, store, **kwargs)
-        except Exception as exc:
+        except Exception:
             self._cw.rollback()
             raise
         else:
diff --git a/cubicweb_eac/views.py b/cubicweb_eac/views.py
--- a/cubicweb_eac/views.py
+++ b/cubicweb_eac/views.py
@@ -267,7 +267,7 @@ class EACImportView(EACImportMixin, View
                 mtype = 'danger'
                 import_log.record_fatal(msg)
                 self._cw.status_out = 400
-            except Exception as exc:  # pylint: disable=broad-except
+            except Exception:  # pylint: disable=broad-except
                 msg = self._cw._('EAC import failed')
                 self.exception('error while importing %s', stream.filename)
                 mtype = 'danger'



More information about the saem-devel mailing list