mirror of
https://github.com/not-kennethreitz/blindspin.git
synced 2026-06-05 06:56:14 +00:00
make spinner 2.6 compatible
This commit is contained in:
@@ -28,7 +28,10 @@ class Spinner(object):
|
||||
|
||||
def init_spin(self):
|
||||
while not self.stop_running.is_set():
|
||||
sys.stdout.write(next(self.spinner_cycle))
|
||||
next_val = next(self.spinner_cycle)
|
||||
if sys.version_info[0] == 2:
|
||||
next_val = next_val.encode('utf-8')
|
||||
sys.stdout.write(next_val)
|
||||
sys.stdout.flush()
|
||||
time.sleep(0.07)
|
||||
sys.stdout.write('\b')
|
||||
|
||||
Reference in New Issue
Block a user