Commit 3c8c90fa authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix repl when stdin gets closed

Also, add simple script to see how many of the Lib/ libraries we can import
parent 485bb2ad
......@@ -179,14 +179,15 @@ int main(int argc, char** argv) {
while (repl) {
char* line = readline(">> ");
AST_Module* m = parse_string(line);
if (!line) {
repl = false;
} else {
add_history(line);
AST_Module* m = parse_string(line);
Timer _t("repl");
if (m->body.size() > 0 && m->body[0]->type == AST_TYPE::Expr) {
AST_Expr* e = ast_cast<AST_Expr>(m->body[0]);
AST_Call* c = new AST_Call();
......
import glob
import os
import subprocess
modules = []
for fn in glob.glob("from_cpython/Lib/*.py"):
modules.append(os.path.basename(fn)[:-3])
for fn in glob.glob("from_cpython/Lib/*"):
if not os.path.isdir(fn):
continue
modules.append(os.path.basename(fn))
print modules
nworked = 0
total = 0
print len(modules)
for m in modules:
p = subprocess.Popen(["./pyston_dbg"], stdin=subprocess.PIPE)
p.stdin.write("import %s\n" % m)
p.stdin.close()
code = p.wait()
if code == 0:
print m, "worked",
nworked += 1
else:
print code
print m, "failed",
total += 1
print "%d/%d" % (nworked, total)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment