MCPcopy Create free account
hub / github.com/dropbox/pyannotate / ModifiedRefactoringTool

Class ModifiedRefactoringTool

pyannotate_tools/annotations/__main__.py:48–59  ·  view source on GitHub ↗

Class that gives a nicer error message for bad encodings.

Source from the content-addressed store, hash-verified

46
47
48class ModifiedRefactoringTool(StdoutRefactoringTool):
49 """Class that gives a nicer error message for bad encodings."""
50
51 def refactor_file(self, filename, write=False, doctests_only=False):
52 try:
53 super(ModifiedRefactoringTool, self).refactor_file(
54 filename, write=write, doctests_only=doctests_only)
55 except SyntaxError as err:
56 if str(err).startswith("unknown encoding:"):
57 self.log_error("Can't parse %s: %s", filename, err)
58 else:
59 raise
60
61
62def dump_annotations(type_info, files):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected