summaryrefslogtreecommitdiff
path: root/example/calceof/calc.py
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2020-02-22 15:57:54 -0600
committerDavid Beazley <dave@dabeaz.com>2020-02-22 15:57:54 -0600
commit1fac9fed647909b92f3779dd34beb8564f6f247b (patch)
treec520f1c56791c541105c1023c8dd68d99853ad8b /example/calceof/calc.py
parent1321375e013425958ea090b55aecae0a4b7face6 (diff)
downloadply-1fac9fed647909b92f3779dd34beb8564f6f247b.tar.gz
Massive refactoring/cleanup
Diffstat (limited to 'example/calceof/calc.py')
-rw-r--r--example/calceof/calc.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/example/calceof/calc.py b/example/calceof/calc.py
index 22b39a4..7bb7e0f 100644
--- a/example/calceof/calc.py
+++ b/example/calceof/calc.py
@@ -8,9 +8,6 @@
import sys
sys.path.insert(0, "../..")
-if sys.version_info[0] >= 3:
- raw_input = input
-
tokens = (
'NAME', 'NUMBER',
)
@@ -36,7 +33,7 @@ def t_newline(t):
def t_eof(t):
- more = raw_input('... ')
+ more = input('... ')
if more:
t.lexer.input(more + '\n')
return t.lexer.token()
@@ -122,9 +119,9 @@ def p_error(p):
import ply.yacc as yacc
yacc.yacc()
-while 1:
+while True:
try:
- s = raw_input('calc > ')
+ s = input('calc > ')
except EOFError:
break
if not s: