try:
xreadlines.xreadlines(Null())[0]
except AttributeError, detail:
- print "AttributeError"
+ print "AttributeError (expected)"
else:
print "Did not throw attribute error"
try:
xreadlines.xreadlines(XReader)[0]
except TypeError, detail:
- print "TypeError"
+ print "TypeError (expected)"
else:
print "Did not throw type error"
try:
xreadlines.xreadlines(XReader())[1]
except RuntimeError, detail:
- print "RuntimeError", detail
+ print "RuntimeError (expected):", detail
else:
print "Did not throw runtime error"
xresult = ['0\n', '1\n', '2\n', '3\n', '0\n', '1\n', '2\n', '0\n', '1\n', '0\n']
for line in xreadlines.xreadlines(XReader()):
- if line != xresult[lineno]: print "line %d differs" % lineno
- lineno = lineno + 1
+ if line != xresult[lineno]:
+ print "line %d differs" % lineno
+ lineno += 1
extern void init_locale(void);
#endif
extern void init_codecs(void);
+extern void initxreadlines(void);
+/* XXX tim: what's the purpose of ADDMODULE MARKER? */
/* -- ADDMODULE MARKER 1 -- */
extern void PyMarshal_Init(void);
#endif
{"_codecs", init_codecs},
+ {"xreadlines", initxreadlines},
+/* XXX tim: what's the purpose of ADDMODULE MARKER? */
/* -- ADDMODULE MARKER 2 -- */
/* This module "lives in" with marshal.c */