From 03fa87151dbc94cf04ee62502192538f5def4981 Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Fri, 27 Jun 2008 16:10:36 +0100 Subject: [PATCH] pyparsing backward compatibility magic "printables" doesn't seem to be available in some older versions of pyparsing so I've put it in myself instead. --- bpython.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bpython.py b/bpython.py index eb8a6a8..05652ef 100644 --- a/bpython.py +++ b/bpython.py @@ -62,7 +62,7 @@ else: try: from pyparsing import Forward, Suppress, QuotedString, dblQuotedString, \ Group, OneOrMore, ZeroOrMore, Literal, Optional, Word, \ - alphas, alphanums, printables, ParseException + alphas, alphanums, ParseException except ImportError: OPTS.arg_spec = False # XXX: This is for later, as the loadrc function checks that it got imported okay. @@ -72,6 +72,9 @@ except ImportError: del sys.modules['pyparsing'] else: OPTS.arg_spec = True +# Some older versions of pyparsing don't seem to have the "printables" so I've +# just put it in here with my bare hands: + printables = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' import pydoc