<div dir="ltr"><div><div>In function 'bsp_configure' of rtems_bsd.py, when conf.options.rtems_libbsd is None, os.path is not imported, which leads to "UnboundLocalError: local variable 'os' referenced before assignment" error.<br><br>This patch tries to avoid that error.<br></div><br></div>-------------------------<br><div><div><div>diff --git a/rtems_bsd.py b/rtems_bsd.py<br>index eaff438..6074f4d 100644<br>--- a/rtems_bsd.py<br>+++ b/rtems_bsd.py<br>@@ -48,6 +48,7 @@ def options(opt):<br>                    help = 'Path to install RTEMS LibBSD (defauls to prefix).')<br> <br> def bsp_configure(conf, arch_bsp):<br>+    import os.path<br>     conf.check(header_name = 'dlfcn.h', features = 'c')<br>     if not rtems.check_posix(conf):<br>         conf.fatal("RTEMS kernel POSIX support is disabled; configure RTEMS with --enable-posix")<br>@@ -56,7 +57,6 @@ def bsp_configure(conf, arch_bsp):<br>     if conf.options.rtems_libbsd is None:<br>         rtems_libbsd_path = conf.env.PREFIX<br>     else:<br>-        import os.path<br>         if not os.path.exists(conf.options.rtems_libbsd):<br>             conf.fatal('RTEMS LibBSD not found')<br>         rtems_libbsd_path = conf.options.rtems_libbsd<br> <br></div></div></div></div>