PR python/13199:
authorTom Tromey <tromey@redhat.com>
Tue, 10 Jan 2012 21:26:39 +0000 (21:26 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 10 Jan 2012 21:26:39 +0000 (21:26 +0000)
* python/python.c (finish_python_initialization): Set sys.argv.

gdb/ChangeLog
gdb/python/python.c

index 00405e5231e57944fc0b51885dac2b73b6f5b0bc..1ac251038b0daa0774ffd16b7a3fd4caa4a28ba4 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-10  Tom Tromey  <tromey@redhat.com>
+
+       PR python/13199:
+       * python/python.c (finish_python_initialization): Set sys.argv.
+
 2012-01-10  Doug Evans  <dje@google.com>
 
        * dwarf2read.c (dwarf_decode_lines): Remove arg "abfd".  New arg
index 5212d4eb927aaacbdedad9e402caa9be276ff5f7..5a0d7767f14aab88011fdfd7ef40917dccbd9ea2 100644 (file)
@@ -1366,6 +1366,9 @@ def GdbSetPythonDirectory (dir):\n\
 GdbSetPythonDirectory (gdb.PYTHONDIR)\n\
 # Default prompt hook does nothing.\n\
 prompt_hook = None\n\
+# Ensure that sys.argv is set to something.\n\
+# We do not use PySys_SetArgvEx because it did not appear until 2.6.6.\n\
+sys.argv = ['']\n\
 ");
 
   do_cleanups (cleanup);