diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2012-11-23 08:54:10 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2012-11-23 08:54:10 +0000 |
commit | 774e46526945ea91265734a2dc82d15eed515577 (patch) | |
tree | 734ae210c20a98f01fe029f7e6eeb7a93b4617fb /src/examples/deltaTime.py | |
parent | 6b12041d4656f4cda910f24acda8d71013166fbd (diff) | |
download | pyparsing-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.py | 10 |
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()
|