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 @@ -206,15 +206,25 @@ def __init__(self, full_config):
206
206
def platform (self ):
207
207
return 'linux'
208
208
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
+
209
219
def platform_name (self ):
210
- name , _ , _ = platform . linux_distribution ()
220
+ name , _ , _ = self . _distribution ()
211
221
# Some distros have spaces, e.g. 'SUSE Linux Enterprise Server'
212
222
# lit features can't have spaces
213
223
name = name .lower ().strip ().replace (' ' , '-' )
214
224
return name # Permitted to be None
215
225
216
226
def platform_ver (self ):
217
- _ , ver , _ = platform . linux_distribution ()
227
+ _ , ver , _ = self . _distribution ()
218
228
ver = ver .lower ().strip ().replace (' ' , '-' )
219
229
return ver # Permitted to be None.
220
230
You can’t perform that action at this time.
0 commit comments