summaryrefslogtreecommitdiff
path: root/src/examples/deltaTime.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2012-11-23 08:54:10 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2012-11-23 08:54:10 +0000
commit774e46526945ea91265734a2dc82d15eed515577 (patch)
tree734ae210c20a98f01fe029f7e6eeb7a93b4617fb /src/examples/deltaTime.py
parent6b12041d4656f4cda910f24acda8d71013166fbd (diff)
downloadpyparsing-git-774e46526945ea91265734a2dc82d15eed515577.tar.gz
Clean up examples to be Python 3 compatible
Diffstat (limited to 'src/examples/deltaTime.py')
-rw-r--r--src/examples/deltaTime.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/examples/deltaTime.py b/src/examples/deltaTime.py
index 8bfcf64..02539e6 100644
--- a/src/examples/deltaTime.py
+++ b/src/examples/deltaTime.py
@@ -59,7 +59,7 @@ def convertToAbsTime(toks):
else:
day = datetime(now.year, now.month, now.day)
if "timeOfDay" in toks:
- if isinstance(toks.timeOfDay,basestring):
+ if isinstance(toks.timeOfDay,str):
timeOfDay = {
"now" : timedelta(0, (now.hour*60+now.minute)*60+now.second, now.microsecond),
"noon" : timedelta(0,0,0,0,0,12),
@@ -196,10 +196,10 @@ noon last Sunday
next Sunday at 2pm""".splitlines()
for t in tests:
- print t, "(relative to %s)" % datetime.now()
+ print(t, "(relative to %s)" % datetime.now())
res = nlTimeExpression.parseString(t)
if "calculatedTime" in res:
- print res.calculatedTime
+ print(res.calculatedTime)
else:
- print "???"
- print
+ print("???")
+ print()