@@ -434,10 +434,8 @@ def __init_finalize__(self, **kwargs):
434
434
if platform in [POWER8 , POWER9 ]:
435
435
# -march isn't supported on power architectures, is -mtune needed?
436
436
self .cflags = ['-mcpu=native' ] + self .cflags
437
- elif platform is Graviton :
438
- # Graviton flag
439
- mx = platform .march
440
- self .cflags = ['-mcpu=%s' % mx ] + self .cflags
437
+ elif isinstance (platform , Graviton ):
438
+ self .cflags = ['-mcpu=%s' % platform .march ] + self .cflags
441
439
else :
442
440
self .cflags = ['-march=native' ] + self .cflags
443
441
@@ -466,9 +464,8 @@ def __init_finalize__(self, **kwargs):
466
464
platform = kwargs .pop ('platform' , configuration ['platform' ])
467
465
468
466
# Graviton flag
469
- if platform is Graviton :
470
- mx = platform .march
471
- self .cflags += ['-mcpu=%s' % mx ]
467
+ if isinstance (platform , Graviton ):
468
+ self .cflags += ['-mcpu=%s' % platform .march ]
472
469
473
470
474
471
class ClangCompiler (Compiler ):
@@ -979,11 +976,8 @@ def __getitem__(self, key):
979
976
return partial (GNUCompiler , suffix = i )
980
977
return super ().__getitem__ (key )
981
978
982
- def has_key (self , k ):
983
- return k in self .keys () or k .startswith ('gcc-' )
984
-
985
979
def __contains__ (self , k ):
986
- return self .has_key ( k )
980
+ return k in self .keys () or k . startswith ( 'gcc-' )
987
981
988
982
989
983
_compiler_registry = {
0 commit comments