Skip to content

Commit 31169fc

Browse files
committed
src/sage/misc/gperftools.py: update for python3
C functions take bytes, not python strings. Without this, the profiler tries to write to "/", fails, and proceeds to do very little.
1 parent a880b3f commit 31169fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sage/misc/gperftools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def start(self):
162162
self._previous_sigprof_handler = self._libc().signal(SIGPROF, SIG_DFL)
163163
profiler = self._libprofiler()
164164
self._t_start = time.time()
165-
rc = profiler.ProfilerStart(self.filename())
165+
rc = profiler.ProfilerStart(str.encode(self.filename()))
166166
if rc < 0:
167167
raise ValueError('profiler failed to start')
168168

0 commit comments

Comments
 (0)