File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -206,15 +206,25 @@ def __init__(self, full_config):
206206 def platform (self ):
207207 return 'linux'
208208
209+ def _distribution (self ):
210+ try :
211+ # linux_distribution is not available since Python 3.8
212+ # However, this function is only used to detect SLES 11,
213+ # which is quite an old distribution that doesn't have
214+ # Python 3.8.
215+ return platform .linux_distribution ()
216+ except AttributeError :
217+ return '' , '' , ''
218+
209219 def platform_name (self ):
210- name , _ , _ = platform . linux_distribution ()
220+ name , _ , _ = self . _distribution ()
211221 # Some distros have spaces, e.g. 'SUSE Linux Enterprise Server'
212222 # lit features can't have spaces
213223 name = name .lower ().strip ().replace (' ' , '-' )
214224 return name # Permitted to be None
215225
216226 def platform_ver (self ):
217- _ , ver , _ = platform . linux_distribution ()
227+ _ , ver , _ = self . _distribution ()
218228 ver = ver .lower ().strip ().replace (' ' , '-' )
219229 return ver # Permitted to be None.
220230
You can’t perform that action at this time.
0 commit comments