Skip to content

Commit

Permalink
More tweaks to suppress errors when pyflakes can't be imported
Browse files Browse the repository at this point in the history
Leo build: 20180203152836
  • Loading branch information
edreamleo committed Feb 3, 2018
1 parent 1a54ca9 commit 2856c36
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
5 changes: 4 additions & 1 deletion flake8-leo.py
Expand Up @@ -22,7 +22,10 @@
#@+node:ekr.20160517182239.10: ** main & helpers
def main(files):
'''Call run on all tables in tables_table.'''
from flake8 import engine
try:
from flake8 import engine
except Exception:
print('can not import flake8')
config_file = get_flake8_config()
if config_file:
style = engine.get_style_guide(
Expand Down
7 changes: 5 additions & 2 deletions leo/commands/checkerCommands.py
Expand Up @@ -8,7 +8,7 @@
import leo.core.leoGlobals as g
try:
import flake8
except ImportError:
except Exception: # May not be ImportError.
flake8 = None
try:
import pyflakes
Expand Down Expand Up @@ -95,7 +95,10 @@ def __init__(self, c, quiet=False):
#@+node:ekr.20160517133049.2: *3* flake8.check_all
def check_all(self, paths):
'''Run flake8 on all paths.'''
from flake8 import engine, main
try:
from flake8 import engine, main
except Exception:
return
config_file = self.get_flake8_config()
if config_file:
style = engine.get_style_guide(
Expand Down
4 changes: 2 additions & 2 deletions leo/core/commit_timestamp.json
@@ -1,4 +1,4 @@
{
"asctime": "Sat Feb 3 15:05:16 CST 2018",
"timestamp": "20180203150517"
"asctime": "Sat Feb 3 15:28:36 CST 2018",
"timestamp": "20180203152836"
}
2 changes: 2 additions & 0 deletions leo/core/leoAtFile.py
Expand Up @@ -4278,6 +4278,8 @@ def runPyflakes(self, root, pyflakes_errors_only):
x = checkerCommands.PyflakesCommand(self.c)
ok = x.run(p=root,pyflakes_errors_only=pyflakes_errors_only)
return ok
else:
return True # Suppress error if pyflakes can not be imported.
except Exception:
g.es_exception()
#@+node:ekr.20090514111518.5665: *6* at.tabNannyNode
Expand Down
2 changes: 1 addition & 1 deletion pyflakes-leo.py
Expand Up @@ -44,7 +44,7 @@ def report_version():
try:
import flake8
print('flake8 version: %s' % flake8.__version__)
except ImportError:
except Exception:
g.trace('can not import flake8')
#@+node:ekr.20160518000549.15: ** scanOptions
def scanOptions():
Expand Down

0 comments on commit 2856c36

Please sign in to comment.