From f73e2571fb643a2afdde365eeee0fe0f3f4f5300 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 24 Oct 2019 20:11:14 -0700 Subject: Use pyupgrade to upgrade the code to use Python3 conventions (#138) The pyupgrade project is available at https://github.com/asottile/pyupgrade and can be installed through pip. The pyupgrade tool automatically upgrades syntax for newer versions of the language. As pyparsing is now Python 3 only, can apply some cleanups and simplifications. Ran the tool using the following command: $ find . -name \*.py -exec pyupgrade --py3-plus {} \; For now, pyparsing.py was skipped while it is refactored to a package. --- examples/rangeCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/rangeCheck.py') diff --git a/examples/rangeCheck.py b/examples/rangeCheck.py index 29e9459..66af545 100644 --- a/examples/rangeCheck.py +++ b/examples/rangeCheck.py @@ -26,7 +26,7 @@ def ranged_value(expr, minval=None, maxval=None): outOfRangeMessage = { (True, False) : "value is greater than %s" % maxval, (False, True) : "value is less than %s" % minval, - (False, False) : "value is not in the range ({0} to {1})".format(minval,maxval), + (False, False) : "value is not in the range ({} to {})".format(minval,maxval), }[minval is None, maxval is None] return expr().addCondition(inRangeCondition, message=outOfRangeMessage) -- cgit v1.2.1