mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Admit that we'll never add the args for a "call" event to the profile
and trace functions; this now declares that None will be passed for the "call" event. This closes SF bug/suggestion #460315.
This commit is contained in:
		
							parent
							
								
									02fac83ba1
								
							
						
					
					
						commit
						b9a96282f1
					
				
					 2 changed files with 9 additions and 11 deletions
				
			
		|  | @ -355,24 +355,25 @@ The events have the following meaning: | ||||||
| 
 | 
 | ||||||
| \item[\code{'call'}] | \item[\code{'call'}] | ||||||
| A function is called (or some other code block entered).  The global | A function is called (or some other code block entered).  The global | ||||||
| trace function is called; arg is the argument list to the function; | trace function is called; \var{arg} is \code{None}; | ||||||
| the return value specifies the local trace function. | the return value specifies the local trace function. | ||||||
| 
 | 
 | ||||||
| \item[\code{'line'}] | \item[\code{'line'}] | ||||||
| The interpreter is about to execute a new line of code (sometimes | The interpreter is about to execute a new line of code (sometimes | ||||||
| multiple line events on one line exist).  The local trace function is | multiple line events on one line exist).  The local trace function is | ||||||
| called; arg in None; the return value specifies the new local trace | called; \var{arg} is \code{None}; the return value specifies the new | ||||||
| function. | local trace function. | ||||||
| 
 | 
 | ||||||
| \item[\code{'return'}] | \item[\code{'return'}] | ||||||
| A function (or other code block) is about to return.  The local trace | A function (or other code block) is about to return.  The local trace | ||||||
| function is called; arg is the value that will be returned.  The trace | function is called; \var{arg} is the value that will be returned.  The | ||||||
| function's return value is ignored. | trace function's return value is ignored. | ||||||
| 
 | 
 | ||||||
| \item[\code{'exception'}] | \item[\code{'exception'}] | ||||||
| An exception has occurred.  The local trace function is called; arg is | An exception has occurred.  The local trace function is called; | ||||||
| a triple (exception, value, traceback); the return value specifies the | \var{arg} is a triple \code{(\var{exception}, \var{value}, | ||||||
| new local trace function | \var{traceback})}; the return value specifies the new local trace | ||||||
|  | function. | ||||||
| 
 | 
 | ||||||
| \end{description} | \end{description} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,6 @@ | ||||||
| /* Execute compiled code */ | /* Execute compiled code */ | ||||||
| 
 | 
 | ||||||
| /* XXX TO DO:
 | /* XXX TO DO:
 | ||||||
|    XXX how to pass arguments to profile and trace functions? |  | ||||||
|    XXX speed up searching for keywords by using a dictionary |    XXX speed up searching for keywords by using a dictionary | ||||||
|    XXX document it! |    XXX document it! | ||||||
|    */ |    */ | ||||||
|  | @ -605,7 +604,6 @@ eval_frame(PyFrameObject *f) | ||||||
| 			   whenever an exception is detected. */ | 			   whenever an exception is detected. */ | ||||||
| 			if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, | 			if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, | ||||||
| 				       f, PyTrace_CALL, Py_None)) { | 				       f, PyTrace_CALL, Py_None)) { | ||||||
| 				/* XXX Need way to compute arguments?? */ |  | ||||||
| 				/* Trace function raised an error */ | 				/* Trace function raised an error */ | ||||||
| 				return NULL; | 				return NULL; | ||||||
| 			} | 			} | ||||||
|  | @ -616,7 +614,6 @@ eval_frame(PyFrameObject *f) | ||||||
| 			if (call_trace(tstate->c_profilefunc, | 			if (call_trace(tstate->c_profilefunc, | ||||||
| 				       tstate->c_profileobj, | 				       tstate->c_profileobj, | ||||||
| 				       f, PyTrace_CALL, Py_None)) { | 				       f, PyTrace_CALL, Py_None)) { | ||||||
| 				/* XXX Need way to compute arguments?? */ |  | ||||||
| 				/* Profile function raised an error */ | 				/* Profile function raised an error */ | ||||||
| 				return NULL; | 				return NULL; | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fred Drake
						Fred Drake