stick_buffer.py: make script compatible with Python 3.x