Issue 3879: fixed docstring error when pyglet is install.
Merge pull request #2216 from eriknw/3879_pyglet_doctest

Issue 3879: fixed docstring error when pyglet is install.