[Lldb-commits] [PATCH] D86821: [lldb] Make the majority of the lit configuration values optional for the API tests

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 2 07:46:19 PDT 2020


labath added inline comments.


================
Comment at: lldb/test/API/lit.cfg.py:88-91
+def is_configured(attr):
+  """Return the configuration attribute if it exists and None otherwise.
+
+  This allows us to check if the attribute exists before trying to access it."""
----------------
I don't think this name and the implementation are  a good match. Given that the usages are a matching the name and not the implementation, maybe just change the implementation to `hasattr(config, attr)`?

That said, I'm not sure that `is_configured("foo")` is significantly better than `hasattr(config, "foo")`, so it might be better to just delete the function altogether.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86821/new/

https://reviews.llvm.org/D86821



More information about the lldb-commits mailing list