[util] Don't do string comparison with 'is' in Python This is wrong, and causes syntax warnings with recent versions of Python 3. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/util/dvsim/OneShotCfg.py b/util/dvsim/OneShotCfg.py index 766ff98..a4d94fc 100644 --- a/util/dvsim/OneShotCfg.py +++ b/util/dvsim/OneShotCfg.py
@@ -122,7 +122,7 @@ # Purge the output directories. This operates on self. def _purge(self): - if self.scratch_path is not "": + if self.scratch_path: try: log.info("Purging scratch path %s", self.scratch_path) os.system("/bin/rm -rf " + self.scratch_path)
diff --git a/util/dvsim/SimCfg.py b/util/dvsim/SimCfg.py index 969263d..e0d04a5 100644 --- a/util/dvsim/SimCfg.py +++ b/util/dvsim/SimCfg.py
@@ -57,7 +57,7 @@ # Set default sim modes for unpacking if self.waves is True: self.en_build_modes.append("waves") if self.cov is True: self.en_build_modes.append("cov") - if self.profile is not 'none': self.en_build_modes.append("profile") + if self.profile != 'none': self.en_build_modes.append("profile") if self.xprop_off is not True: self.en_build_modes.append("xprop") # Options built from cfg_file files @@ -169,7 +169,7 @@ # Purge the output directories. This operates on self. def _purge(self): - if self.scratch_path is not "": + if self.scratch_path: try: log.info("Purging scratch path %s", self.scratch_path) os.system("/bin/rm -rf " + self.scratch_path)