Merge "Prevent hacking.py from crashing on unexpected import exception"

This commit is contained in:
Jenkins
2013-02-28 17:18:06 +00:00
committed by Gerrit Code Review
+6
View File
@@ -29,6 +29,7 @@ import re
import subprocess
import sys
import tokenize
import traceback
import pep8
@@ -210,6 +211,11 @@ def nova_import_rules(logical_line):
_missingImport.add(missing)
return True
return False
except Exception, exc:
# NOTE(jogo) don't stack trace if unexpected import error,
# log and continue.
traceback.print_exc()
return False
return True
def is_module(mod):