summaryrefslogtreecommitdiffstats
path: root/Modules/cgen.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-09-11 23:55:51 (GMT)
committerGuido van Rossum <guido@python.org>1992-09-11 23:55:51 (GMT)
commit5c85062e1ce4c7e51daaad1a4eb3f66f6b5a0ea8 (patch)
tree7232c5445b143972568fc02f5ad11e02cd2383f0 /Modules/cgen.py
parentd10d8291f1de5bef74628bd1c766403ee9444dca (diff)
downloadcpython-5c85062e1ce4c7e51daaad1a4eb3f66f6b5a0ea8.zip
cpython-5c85062e1ce4c7e51daaad1a4eb3f66f6b5a0ea8.tar.gz
cpython-5c85062e1ce4c7e51daaad1a4eb3f66f6b5a0ea8.tar.bz2
Makefile uses $> more often; cgen supports filename argument; added
lower, upper and swapcase to strop; cosmetics.
Diffstat (limited to 'Modules/cgen.py')
-rw-r--r--Modules/cgen.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/cgen.py b/Modules/cgen.py
index d6e9c96..ea46263 100644
--- a/Modules/cgen.py
+++ b/Modules/cgen.py
@@ -376,6 +376,11 @@ def mkobject(type, arg):
return 'mknew' + type + 'object(' + arg + ')'
+# Open optional file argument
+if sys.argv[1:]:
+ sys.stdin = open(sys.argv[1], 'r')
+
+
# Input line number
lno = 0