Show More
@@ -226,20 +226,12 b' python-profiler package from non-free.""")' | |||
|
226 | 226 | |
|
227 | 227 | # Trap output. |
|
228 | 228 | stdout_trap = StringIO() |
|
229 | ||
|
230 | if hasattr(stats,'stream'): | |
|
231 | # In newer versions of python, the stats object has a 'stream' | |
|
232 | # attribute to write into. | |
|
233 | stats.stream = stdout_trap | |
|
234 | stats.print_stats(*lims) | |
|
235 | else: | |
|
236 | # For older versions, we manually redirect stdout during printing | |
|
237 | sys_stdout = sys.stdout | |
|
229 | stats_stream = stats.stream | |
|
238 | 230 |
|
|
239 |
|
|
|
231 | stats.stream = stdout_trap | |
|
240 | 232 |
|
|
241 | 233 |
|
|
242 |
|
|
|
234 | stats.stream = stats_stream | |
|
243 | 235 | |
|
244 | 236 | output = stdout_trap.getvalue() |
|
245 | 237 | output = output.rstrip() |
General Comments 0
You need to be logged in to leave comments.
Login now