fixed locale deprecation warning

This commit is contained in:
Félix Boisselier committed 2023-12-26 19:50:34 +01:00
1 parent d1394ad841
commit f385bd98e3
4 files changed
+12 -4

No files matched your search

+3 -1
View File
@@ -22,7 +22,9 @@ NUM_POINTS = 500
# Set the best locale for time and date formating (generation of the titles) # Set the best locale for time and date formating (generation of the titles)
try: try:
locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) current_locale = locale.getlocale(locale.LC_TIME)
if current_locale is None or current_locale[0] is None:
locale.setlocale(locale.LC_TIME, 'C')
except locale.Error: except locale.Error:
locale.setlocale(locale.LC_TIME, 'C') locale.setlocale(locale.LC_TIME, 'C')
+3 -1
View File
@@ -46,7 +46,9 @@ KLIPPAIN_COLORS = {
# Set the best locale for time and date formating (generation of the titles) # Set the best locale for time and date formating (generation of the titles)
try: try:
locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) current_locale = locale.getlocale(locale.LC_TIME)
if current_locale is None or current_locale[0] is None:
locale.setlocale(locale.LC_TIME, 'C')
except locale.Error: except locale.Error:
locale.setlocale(locale.LC_TIME, 'C') locale.setlocale(locale.LC_TIME, 'C')
+3 -1
View File
@@ -40,7 +40,9 @@ KLIPPAIN_COLORS = {
# Set the best locale for time and date formating (generation of the titles) # Set the best locale for time and date formating (generation of the titles)
try: try:
locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) current_locale = locale.getlocale(locale.LC_TIME)
if current_locale is None or current_locale[0] is None:
locale.setlocale(locale.LC_TIME, 'C')
except locale.Error: except locale.Error:
locale.setlocale(locale.LC_TIME, 'C') locale.setlocale(locale.LC_TIME, 'C')
+3 -1
View File
@@ -38,7 +38,9 @@ KLIPPAIN_COLORS = {
# Set the best locale for time and date formating (generation of the titles) # Set the best locale for time and date formating (generation of the titles)
try: try:
locale.setlocale(locale.LC_TIME, locale.getdefaultlocale()) current_locale = locale.getlocale(locale.LC_TIME)
if current_locale is None or current_locale[0] is None:
locale.setlocale(locale.LC_TIME, 'C')
except locale.Error: except locale.Error:
locale.setlocale(locale.LC_TIME, 'C') locale.setlocale(locale.LC_TIME, 'C')