2525
2626from enum import IntFlag
2727from gettext import gettext as _
28- from typing import Final , Optional , TextIO
28+ from typing import Final , List , Optional , TextIO
2929
3030from diffuse import constants
3131from diffuse .resources import theResources
@@ -106,7 +106,7 @@ def logErrorAndDialog(msg: str, parent: Gtk.Widget = None) -> None:
106106 dialog .destroy ()
107107
108108
109- def make_subdirs (p : str , ss : list [str ]) -> str :
109+ def make_subdirs (p : str , ss : List [str ]) -> str :
110110 '''Create nested subdirectories and return the complete path.'''
111111 for s in ss :
112112 p = os .path .join (p , s )
@@ -221,7 +221,7 @@ def strip_eol(s: str) -> str:
221221 return s
222222
223223
224- def _strip_eols (ss : list [str ]) -> list [str ]:
224+ def _strip_eols (ss : List [str ]) -> List [str ]:
225225 '''Returns the list of strings without line ending characters.'''
226226 return [strip_eol (s ) for s in ss ]
227227
@@ -232,7 +232,7 @@ def popenReadLines(dn, cmd, prefs, bash_pref, success_results=None):
232232 dn , cmd , prefs , bash_pref , success_results ).decode ('utf-8' , errors = 'ignore' )))
233233
234234
235- def readconfiglines (fd : TextIO ) -> list [str ]:
235+ def readconfiglines (fd : TextIO ) -> List [str ]:
236236 return fd .read ().replace ('\r ' , '' ).split ('\n ' )
237237
238238
@@ -243,7 +243,7 @@ def globEscape(s: str) -> str:
243243
244244
245245# split string into lines based upon DOS, Mac, and Unix line endings
246- def splitlines (text : str ) -> list [str ]:
246+ def splitlines (text : str ) -> List [str ]:
247247 # split on new line characters
248248 temp , i , n = [], 0 , len (text )
249249 while i < n :
@@ -272,7 +272,7 @@ def splitlines(text: str) -> list[str]:
272272
273273
274274# also recognize old Mac OS line endings
275- def readlines (fd : TextIO ) -> list [str ]:
275+ def readlines (fd : TextIO ) -> List [str ]:
276276 return _strip_eols (splitlines (fd .read ()))
277277
278278
0 commit comments