]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[YoutubeDL] Output python implementation in debug header
authorSergey M․ <dstftw@gmail.com>
Mon, 1 Jan 2018 14:52:24 +0000 (21:52 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 1 Jan 2018 14:52:24 +0000 (21:52 +0700)
youtube_dl/YoutubeDL.py

index ace80f14b8bdac8dca7c3d87e08179ead17c5c02..97bd9c526dc60d71d569b625e2cebd7c6af46bd0 100755 (executable)
@@ -2233,8 +2233,16 @@ class YoutubeDL(object):
                 sys.exc_clear()
             except Exception:
                 pass
-        self._write_string('[debug] Python version %s - %s\n' % (
-            platform.python_version(), platform_name()))
+
+        def python_implementation():
+            impl_name = platform.python_implementation()
+            if impl_name == 'PyPy' and hasattr(sys, 'pypy_version_info'):
+                return impl_name + ' version %d.%d.%d' % sys.pypy_version_info[:3]
+            return impl_name
+
+        self._write_string('[debug] Python version %s (%s) - %s\n' % (
+            platform.python_version(), python_implementation(),
+            platform_name()))
 
         exe_versions = FFmpegPostProcessor.get_versions(self)
         exe_versions['rtmpdump'] = rtmpdump_version()