Debugging a Python Program that Hangs

Ross Ridge rridge at csclub.uwaterloo.ca
Wed Dec 3 21:21:20 CET 2008


Kevin D. Smith  <Kevin.Smith at sas.com> wrote:
>I have a fairly large python program that, when a certain combination 
>of options is used, hangs.  I have no idea where it is hanging, so 
>simply putting in print statements to locate the spot would be quite 
>difficult.  Unfortunately, ctrl-C'ing the program doesn't print a 
>traceback either. 

Have you tried catching the KeyboardInterrupt exception and printing
an exception?  Something like:

	try:
		rest_of_program()
	except KeyboardInterrupt:
		traceback.print_exc()
		raise

				Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge at csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //	  



More information about the Python-list mailing list