From 9cb2f17f0f46ac040055ce990322070924c6b6b3 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 14 Dec 2014 20:35:35 +0000 Subject: [PATCH] Added a refinement to the pyflakes management command, to make it clearer where exceptions while running pyflakes originate. - Legacy-Id: 8747 --- ietf/utils/management/commands/pyflakes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ietf/utils/management/commands/pyflakes.py b/ietf/utils/management/commands/pyflakes.py index 4124aba46..713f35dc2 100644 --- a/ietf/utils/management/commands/pyflakes.py +++ b/ietf/utils/management/commands/pyflakes.py @@ -92,7 +92,11 @@ def checkPaths(filenames, verbosity): for dirpath, dirnames, filenames in os.walk(arg): for filename in filenames: if filename.endswith('.py'): - warnings.extend(checkPath(os.path.join(dirpath, filename), verbosity)) + try: + warnings.extend(checkPath(os.path.join(dirpath, filename), verbosity)) + except TypeError as e: + print("Exception while processing dirpath=%s, filename=%s: %s" % (dirpath, filename,e )) + raise else: warnings.extend(checkPath(arg, verbosity)) return warnings