Skip to content

Instantly share code, notes, and snippets.

@kergoth
Last active April 1, 2022 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kergoth/33c11ac5aa0b130e095743d5405e6fd2 to your computer and use it in GitHub Desktop.
Save kergoth/33c11ac5aa0b130e095743d5405e6fd2 to your computer and use it in GitHub Desktop.
import importlib
import importlib.machinery
class BBPythonPathFinder(importlib.machinery.PathFinder):
@classmethod
def find_spec(cls, fullname, path=None, target=None):
"""Try to find a spec for 'fullname' on bb_pythonpath or 'path'."""
if path is None:
path = bb_pythonpath
return super().find_spec(fullname, path, target)
sys.meta_path.append(BBPythonPathFinder)
bb.utils._context['oe'] = importlib.import_module('oe')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment