]> git.phdru.name Git - extfs.d.git/blobdiff - torrent
Fix(locale): Do not call `locale.getdefaultlocale()` under Python 3.11+
[extfs.d.git] / torrent
diff --git a/torrent b/torrent
index 550ad72ebf9c1f459e12a5cfa7b0eccf19bb2207..1a3c2c17b302266296dc6bf1ac833d7d94bb1beb 100755 (executable)
--- a/torrent
+++ b/torrent
@@ -56,7 +56,10 @@ except ImportError:
 if use_locale:
     # Get the default charset.
     try:
-        lcAll = locale.getdefaultlocale()
+        if sys.version_info[:2] < (3, 11):
+            lcAll = locale.getdefaultlocale()
+        else:
+            lcAll = []
     except locale.Error as err:
         #print("WARNING:", err, file=sys.stderr)
         lcAll = []