Hello,

On Tue, Feb 23, 2016 at 01:46:25PM +0900, Minoru TAKAHASHI wrote:
> Hi Xandaros,
> 
> On 2016年02月22日 23:47, Xandaros wrote:
> > Hello,
> > 
> > Say I have the following three files:
> > /a/a.py
> > /a/b.py
> > /b/b.py
> > 
> > And I start ryu like this:
> > ryu /a/a.py /b/b.py
> > 
> > It will actually load the apps /a/a.py and /a/b.py, NOT /b/b.py
> 
> Thank you for your report.
> Although I tried to check, perhaps, it is a bug of ryu/utils.py.
> I will make a patch for this.
> 
> If hurry, please correct ryu/utils.py as follows.
> 
> ---------------------------------------------
> def import_module(modname):
>     try:
>         __import__(modname)
>     except:
>         abspath = os.path.abspath(modname)
>         mod = _find_loaded_module(abspath)
>         if mod:
>             return mod
> -        opath = sys.path
> +        opath = list(sys.path)
>         sys.path.append(os.path.dirname(abspath))
>         name = os.path.basename(modname)
>         if name.endswith('.py'):
>             name = name[:-3]
>         __import__(name)
>         sys.path = opath
>         return sys.modules[name]
>     return sys.modules[modname]
> ---------------------------------------------

That did indeed fix it, thank you very much.

> 
> Note:
>   opath = sys.path       : means call by *reference*
>   opath = list(sys.path) : means call by *value*
> 
> thanks,
> 

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to