Comment 2 for bug 72227

Revision history for this message
Forest Bond (forest-bond) wrote : Re: [Bug 72227] bzr fails when run within certain Python code trees

On Fri, Nov 17, 2006 at 11:23:51PM -0000, Martin Pool wrote:
> Good idea, thanks.

Sure. You probably want something like this:

--------------------------------------------------------------------------------
import os, sys

cwd = os.getcwd()
if not (cwd == os.path.dirname(os.__file__))):
    sys.path.remove(cwd)
sys.path.remove('')
--------------------------------------------------------------------------------

Not to tell you what to do :) Just felt bad for recommending the wrong option
before.

-Forest