This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Fix syntax in "post event insertion" test.


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" "" \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]