diff --git a/yt_dlp/compat/types.py b/yt_dlp/compat/types.py index ae70245642..4aa3b0efdd 100644 --- a/yt_dlp/compat/types.py +++ b/yt_dlp/compat/types.py @@ -7,6 +7,7 @@ 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)