mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
make/_misoc_import: force external path search
This commit is contained in:
parent
138181fa87
commit
440b7d5170
1 changed files with 5 additions and 1 deletions
6
make.py
6
make.py
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import argparse, importlib, subprocess, struct
|
||||
import sys, argparse, importlib, subprocess, struct
|
||||
|
||||
from mibuild.tools import write_to_file
|
||||
from migen.util.misc import autotype
|
||||
|
@ -31,6 +31,10 @@ def _get_args():
|
|||
|
||||
def _misoc_import(default, external, name):
|
||||
if external:
|
||||
try:
|
||||
del sys.modules[name] # force external path search
|
||||
except KeyError:
|
||||
pass
|
||||
loader = importlib.find_loader(name, [external])
|
||||
if loader is None:
|
||||
raise ImportError("Module not found: "+name)
|
||||
|
|
Loading…
Reference in a new issue