public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [commit] Fix syntax in "post event insertion" test.
@ 2010-08-16 18:09 Doug Evans
  0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2010-08-16 18:09 UTC (permalink / raw)
  To: pmuldoon, gdb-patches

Hi.

I've committed this patch.

I was getting the following error (with python 2.4):

>PASS: gdb.python/python.exp: post event insertion -     someVal += 1
gdb.post_event(Foo())
>PASS: gdb.python/python.exp: post event insertion - gdb.post_event(Foo())
end
  File "<string>", line 2
    class Foo():
              ^
SyntaxError: invalid syntax
Error while executing Python code.
(gdb) PASS: gdb.python/python.exp: post event insertion - end
python print someVal
Traceback (most recent call last):
  File "<string>", line 1, in ?
NameError: name 'someVal' is not defined
Error while executing Python code.
(gdb) FAIL: gdb.python/python.exp: test post event execution
python gdb.post_event(str(1))
Traceback (most recent call last):
  File "<string>", line 1, in ?
RuntimeError: Posted event is not callable
Error while executing Python code.


IIUC, "class Name():" is invalid.
Defining a class without any baseclasses can be done in two ways:

Old style: "class Name:"

New style: "class Name(object):"

2010-08-16  Doug Evans  <dje@google.com>

	* gdb.python/python.exp: Fix syntax in "post event insertion" test.

Index: python.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/python.exp,v
retrieving revision 1.12
diff -u -p -r1.12 python.exp
--- python.exp	11 Aug 2010 20:54:12 -0000	1.12
+++ python.exp	16 Aug 2010 17:59:39 -0000
@@ -124,7 +124,7 @@ gdb_test "python print x" "23"
 gdb_py_test_multiple "post event insertion" \
   "python" "" \
   "someVal = 0" "" \
-  "class Foo():" "" \
+  "class Foo(object):" "" \
   "  def __call__(self):" "" \
   "    global someVal" "" \
   "    someVal += 1" "" \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-16 18:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-16 18:09 [commit] Fix syntax in "post event insertion" test Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).