Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a385d33 commit 2baedb0Copy full SHA for 2baedb0
lib/matplotlib/animation.py
@@ -27,7 +27,12 @@
27
import platform
28
import sys
29
import itertools
30
-import base64
+try:
31
+ # python3
32
+ from base64 import encodebytes
33
+except ImportError:
34
+ # python2
35
+ from base64 import encodestring as encodebytes
36
import contextlib
37
import tempfile
38
from matplotlib.cbook import iterable, is_string_like
@@ -927,7 +932,7 @@ def to_html5_video(self):
927
932
928
933
# Now open and base64 encode
929
934
with open(f.name, 'rb') as video:
930
- vid64 = base64.encodebytes(video.read())
935
+ vid64 = encodebytes(video.read())
931
936
self._base64_video = vid64.decode('ascii')
937
self._video_size = 'width="{0}" height="{1}"'.format(
938
*writer.frame_size)
0 commit comments