Browse Source

Fix e0c4db04dc82a699bdabd9821ddc239ebe17d30a for pypy

pukkandan 1 year ago
parent
commit
25b6e8f946
1 changed files with 3 additions and 2 deletions
  1. 3 2
      yt_dlp/compat/types.py

+ 3 - 2
yt_dlp/compat/types.py

@@ -7,6 +7,7 @@ passthrough_module(__name__, 'types')
 del passthrough_module
 
 try:
-    NoneType  # >= 3.10
-except NameError:
+    # NB: pypy has builtin NoneType, so checking NameError won't work
+    from types import NoneType  # >= 3.10
+except ImportError:
     NoneType = type(None)