mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	Added a docstring for the closed attribute.
write_header():  When we encounter a non-string object in sys.path, record
    a fairly mindless placeholder rather than dying.  Possibly could record
    the repr of the object found, but not clear whether that matters.
			
			
This commit is contained in:
		
							parent
							
								
									04e7032c6e
								
							
						
					
					
						commit
						d1eb8b61d0
					
				
					 1 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
					@ -1180,7 +1180,8 @@ profiler_get_closed(ProfilerObject *self, void *closure)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static PyGetSetDef profiler_getsets[] = {
 | 
					static PyGetSetDef profiler_getsets[] = {
 | 
				
			||||||
    {"closed", (getter)profiler_get_closed, NULL},
 | 
					    {"closed", (getter)profiler_get_closed, NULL,
 | 
				
			||||||
 | 
					     "True if the profiler's output file has already been closed."},
 | 
				
			||||||
    {NULL}
 | 
					    {NULL}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1437,10 +1438,14 @@ write_header(ProfilerObject *self)
 | 
				
			||||||
    for (i = 0; i < len; ++i) {
 | 
					    for (i = 0; i < len; ++i) {
 | 
				
			||||||
        PyObject *item = PyList_GET_ITEM(temp, i);
 | 
					        PyObject *item = PyList_GET_ITEM(temp, i);
 | 
				
			||||||
        buffer = PyString_AsString(item);
 | 
					        buffer = PyString_AsString(item);
 | 
				
			||||||
        if (buffer == NULL)
 | 
					        if (buffer == NULL) {
 | 
				
			||||||
            return -1;
 | 
					            pack_add_info(self, "sys-path-entry", "<non-string-path-entry>");
 | 
				
			||||||
 | 
					            PyErr_Clear();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else {
 | 
				
			||||||
            pack_add_info(self, "sys-path-entry", buffer);
 | 
					            pack_add_info(self, "sys-path-entry", buffer);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    pack_frame_times(self);
 | 
					    pack_frame_times(self);
 | 
				
			||||||
    pack_line_times(self);
 | 
					    pack_line_times(self);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue