diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 00405e5231e..1ac251038b0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-01-10 Tom Tromey + + PR python/13199: + * python/python.c (finish_python_initialization): Set sys.argv. + 2012-01-10 Doug Evans * dwarf2read.c (dwarf_decode_lines): Remove arg "abfd". New arg diff --git a/gdb/python/python.c b/gdb/python/python.c index 5212d4eb927..5a0d7767f14 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -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);