From e5fdf0dacad34f3f79d5cc1862c2f1c94b83836a Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Wed, 6 Jun 2007 11:36:48 -0700
Subject: [PATCH] bin/allmydata-tahoe: also update PYTHONPATH so that child
 processes (like twistd) will work

---
 bin/allmydata-tahoe | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/allmydata-tahoe b/bin/allmydata-tahoe
index 433095ba..53ad0074 100644
--- a/bin/allmydata-tahoe
+++ b/bin/allmydata-tahoe
@@ -20,6 +20,14 @@ if len(where) >= 2 and where[-2] == "bin":
         # we've found our home
         libdir = os.path.join(base, "instdir", "lib")
         sys.path.insert(0, libdir)
+        # also update PYTHONPATH so that child processes (like twistd) will
+        # use this too
+        pp = os.environ.get("PYTHONPATH")
+        if pp:
+            pp = libdir + ":" + pp
+        else:
+            pp = libdir
+        os.environ["PYTHONPATH"] = pp
 
 from allmydata.scripts import runner
 runner.run()
-- 
2.45.2