[damned-lies] Fix flake8 errors



commit 6384cbf9fc67d29f1a867f7511b7320289de51f6
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri Sep 17 09:29:03 2021 +0200

    Fix flake8 errors

 common/utils.py    | 2 +-
 languages/views.py | 4 ++--
 stats/utils.py     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/common/utils.py b/common/utils.py
index a8f75719..f008f51f 100644
--- a/common/utils.py
+++ b/common/utils.py
@@ -42,7 +42,7 @@ def run_shell_command(cmd, input_data=None, raise_on_error=False, env=None,
             run_shell_command(['git', 'reset', '--hard'], cwd=cwd)
         raise OSError(
             status,
-            'Command: "%s", Error: %s' % (cmd, errout.decode('utf-8') if errout else output)
+            'Command: "%s", Error: %s' % (cmd, result.stderr or result.stdout)
         )
 
     return (status, result.stdout, result.stderr)
diff --git a/languages/views.py b/languages/views.py
index d82c377a..cab905ae 100644
--- a/languages/views.py
+++ b/languages/views.py
@@ -132,7 +132,7 @@ def language_release_xml(request, locale, release_name):
                 content += "<module id=\"gnome-devel-docs\" branch=\"%s\">" % mod.keys()[0]
                 content += get_domain_stats(mod.values()[0], "document")
                 content += "</module>"
-            except:  # FIXME: which exception is this catching?
+            except Exception:  # FIXME: which exception is this catching?
                 pass
         if catname == 'desktop':
             try:
@@ -140,7 +140,7 @@ def language_release_xml(request, locale, release_name):
                 content += "<module id=\"gnome-user-docs\" branch=\"%s\">" % mod.keys()[0]
                 content += get_domain_stats(mod.values()[0], "document")
                 content += "</module>"
-            except:  # FIXME: which exception is this catching?
+            except Exception:  # FIXME: which exception is this catching?
                 pass
 
         if catname != 'default':
diff --git a/stats/utils.py b/stats/utils.py
index 2b2eb2f8..70f4123b 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -394,7 +394,7 @@ def po_grep(in_file, out_file, filter_):
     else:
         try:
             filter_loc, filter_str = filter_.split("|")
-        except:
+        except Exception:
             # Probably bad filter syntax in DB (TODO: log it)
             return
     grepfilter = pogrep.GrepFilter(filter_str, filter_loc, useregexp=True, invertmatch=True, 
keeptranslations=True)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]