Commit 25517945 by Eric Coissac

Patch a bug in the progressbar printing leading to a bus error with some

C compiler and Cython version >+ 0.24
parent 7b2d3ed8
......@@ -110,23 +110,23 @@ cdef class ProgressBar:
if self.ontty:
fraction=<int>(percent * 50.)
self.arrow=(self.arrow+1) % 4
self.diese[fraction]=0
self.spaces[50 - fraction]=0
if days:
<void>fprintf(stderr,b'\r%s %5.1f %% |%s%c%s] remain : %d days %02d:%02d:%02d',
<void>fprintf(stderr,b'\r%s %5.1f %% |%.*s%c%.*s] remain : %d days %02d:%02d:%02d',
self.chead,
percent*100,
self.diese,self.wheel[self.arrow],self.spaces,
fraction,self.diese,
self.wheel[self.arrow],
50-fraction,self.spaces,
days,hour,minu,sec)
else:
<void>fprintf(stderr,b'\r%s %5.1f %% |%s%c%s] remain : %02d:%02d:%02d',
<void>fprintf(stderr,b'\r%s %5.1f %% |%.*s%c%.*s] remain : %02d:%02d:%02d',
self.chead,
percent*100.,
self.diese,self.wheel[self.arrow],self.spaces,
fraction,self.diese,
self.wheel[self.arrow],
50-fraction,self.spaces,
hour,minu,sec)
self.diese[fraction]=b'#'
self.spaces[50 - fraction]=b' '
tenth = int(percent * 10)
if tenth != self.lastlog:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment