File tree 1 file changed +12
-2
lines changed 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -207,15 +207,25 @@ def __init__(self, full_config):
207
207
def platform (self ):
208
208
return 'linux'
209
209
210
+ def _distribution (self ):
211
+ try :
212
+ # linux_distribution is not available since Python 3.8
213
+ # However, this function is only used to detect SLES 11,
214
+ # which is quite an old distribution that doesn't have
215
+ # Python 3.8.
216
+ return platform .linux_distribution ()
217
+ except AttributeError :
218
+ return '' , '' , ''
219
+
210
220
def platform_name (self ):
211
- name , _ , _ = platform . linux_distribution ()
221
+ name , _ , _ = self . _distribution ()
212
222
# Some distros have spaces, e.g. 'SUSE Linux Enterprise Server'
213
223
# lit features can't have spaces
214
224
name = name .lower ().strip ().replace (' ' , '-' )
215
225
return name # Permitted to be None
216
226
217
227
def platform_ver (self ):
218
- _ , ver , _ = platform . linux_distribution ()
228
+ _ , ver , _ = self . _distribution ()
219
229
ver = ver .lower ().strip ().replace (' ' , '-' )
220
230
return ver # Permitted to be None.
221
231
You can’t perform that action at this time.
0 commit comments