From e73e6ed88626c66527cef03cf18ef3a498c97f51 Mon Sep 17 00:00:00 2001 From: Jacob Bower Date: Fri, 19 Jul 2024 17:13:08 -0700 Subject: [PATCH] Do not suppress CinderX import errors by default Summary: CinderX failing to initialize correctly can lead to cryptic errors in some tests which waste a lot of time tracking down. We suppressed these by default because we had some issues, I think particularly with the OSS build, with bootstrapping during the build. As we don't use the OSS build anymore we should no longer need to do this most of the time. Reviewed By: alexmalyshev Differential Revision: D59889831 fbshipit-source-id: b89082c1b5ab3aaa277c044ebea37cf661435cc2 --- Lib/site.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Lib/site.py b/Lib/site.py index eaa9e17d1c1..74942a99573 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -582,20 +582,6 @@ def execusercustomize(): (err.__class__.__name__, err)) -# TODO(T172877814) remove -def init_cinder(): - # ensure the CinderX pure-Python code is importable (only needed for in-repo - # builds; Buck installs CinderX alongside the stdlib) - cinderx_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'cinderx/PythonLib')) - if os.path.isdir(cinderx_dir): - sys.path.append(cinderx_dir) - try: - import cinderx - cinderx.init() - except (ImportError, AttributeError): - pass - - def main(): """Add standard site-specific directories to the module search path. @@ -621,7 +607,8 @@ def main(): sethelper() if not sys.flags.isolated: enablerlcompleter() - init_cinder() + import cinderx + cinderx.init() execsitecustomize() if ENABLE_USER_SITE: execusercustomize()