diff options
-rw-r--r-- | Lib/shlex.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/shlex.py b/Lib/shlex.py index 95d08d2..575fc35 100644 --- a/Lib/shlex.py +++ b/Lib/shlex.py @@ -158,6 +158,14 @@ class shlex: newfile = newfile[1:-1] return (newfile, open(newfile, "r")) + def error_leader(self, infile=None, lineno=None): + "Emit a C-compiler-like, Emacs-friendly error-message leader." + if not infile: + infile = self.infile + if not lineno: + lineno = self.lineno + return "\"%s\", line %d: " % (infile, lineno) + if __name__ == '__main__': lexer = shlex() |