mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 10:26:02 +00:00 
			
		
		
		
	 7f14f0d8a0
			
		
	
	
		7f14f0d8a0
		
	
	
	
	
		
			
			svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
  r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines
  Recorded merge of revisions 81029 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk
  ........
    r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
    Untabify C files. Will watch buildbots.
  ........
................
		
	
			
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			740 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			740 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* Simple program that repeatedly calls Py_Initialize(), does something, and
 | |
|    then calls Py_Finalize().  This should help finding leaks related to
 | |
|    initialization. */
 | |
| 
 | |
| #include "Python.h"
 | |
| 
 | |
| main(int argc, char **argv)
 | |
| {
 | |
|     int count = -1;
 | |
|     char *command;
 | |
| 
 | |
|     if (argc < 2 || argc > 3) {
 | |
|         fprintf(stderr, "usage: loop <python-command> [count]\n");
 | |
|         exit(2);
 | |
|     }
 | |
|     command = argv[1];
 | |
| 
 | |
|     if (argc == 3) {
 | |
|         count = atoi(argv[2]);
 | |
|     }
 | |
| 
 | |
|     Py_SetProgramName(argv[0]);
 | |
| 
 | |
|     /* uncomment this if you don't want to load site.py */
 | |
|     /* Py_NoSiteFlag = 1; */
 | |
| 
 | |
|     while (count == -1 || --count >= 0 ) {
 | |
|         Py_Initialize();
 | |
|         PyRun_SimpleString(command);
 | |
|         Py_Finalize();
 | |
|     }
 | |
|     return 0;
 | |
| }
 |