diff options
| author | Warren J. Hack <hack@stsci.edu> | 2018-05-01 10:26:24 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2018-05-01 10:26:24 -0400 | 
| commit | 803ce780675d76b23ca142da201720eeb26863a2 (patch) | |
| tree | b38f21408b3b8055350a8f88777b37a9e593a741 | |
| parent | 339734316f1d990b04692516bc25e50d4667cb6f (diff) | |
| download | verhawk-803ce780675d76b23ca142da201720eeb26863a2.tar.gz | |
Add logic to ignore bad modules (#5)
| -rw-r--r-- | verhawk/scanner.py | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/verhawk/scanner.py b/verhawk/scanner.py index 9a27bb0..065c0ca 100644 --- a/verhawk/scanner.py +++ b/verhawk/scanner.py @@ -52,8 +52,10 @@ class Scanner(object):                          module = None                          with open(os.devnull, 'w') as devnull:                              sys.stdout = devnull -                            module = importer.find_module(modname).load_module(modname) - +                            try: +                                module = importer.find_module(modname).load_module(modname) +                            except (KeyError, FileNotFoundError): +                                self.versions[modname] = None                          sys.stdout = constants.STDOUT                          try: | 
