From: Robert W. B. <rb...@di...> - 2001-11-02 02:04:36
|
On Mon, 29 Oct 2001 Mat...@i2... wrote: > On 10/27/2001 10:03:47 PM "Robert W. Bill" wrote: > > > > Wait for a patch <g> > > > > Did a little digging - I think its a one line fix, and this fix does work > for me, I've only had a sec to look at this, so forgive the guessing... Your fix seems to work with first-level package modules. Something is still off with nested packages though. If I have package "two" inside package "one" like so: +Lib +--one/ +--A.py +--__init__.py +--two/ +--B.py +--__init__.py You've solved "from one import A". Definately a step in the right direction. It doesn't seem to fix "from one.two import B" or "from one import two". > but not sure if it might break something else...? SyspathArchive.makeEntry only really affects loadFromZipFile in imp.java. This makes side-effects unlikely. -robert > I'm not sure how patches should be generated, so here is what I did. > > In jython/org/python/core/SyspathArchive.java, change makeEntry from: > > private String makeEntry(String entry) { > String archive = super.toString(); > int idx = archive.indexOf('!'); > if (idx < 0) { > return entry; > } > String folder = archive.substring(idx+1); > return folder + "/" + entry; > } > > To: > > private String makeEntry(String entry) { > String archive = super.toString(); > int idx = archive.indexOf('!'); > if (idx < 0) { > return entry; > } > String folder = archive.substring(idx+1).replace('!', '/'); > return folder + "/" + entry; > } > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |