[tor-commits] [flashproxy/master] Look for flashproxy-reg-http.py in the same directory as connector.py.
dcf at torproject.org
dcf at torproject.org
Wed May 2 20:59:29 UTC 2012
commit fbf164eb542e4d9a29ab66a3abd37ed588ba43cc
Author: David Fifield <david at bamsoftware.com>
Date: Wed May 2 13:54:18 2012 -0700
Look for flashproxy-reg-http.py in the same directory as connector.py.
---
connector.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/connector.py b/connector.py
index 3e2bfd9..8a2b7e1 100755
--- a/connector.py
+++ b/connector.py
@@ -605,8 +605,13 @@ def register():
if not options.register:
return
+ # sys.path[0] is initialized to the directory containing the Python script file.
+ script_dir = sys.path[0]
+ if not script_dir:
+ # Maybe the script was read from stdin; in any case don't guess at the directory.
+ return
+ command = [os.path.join(script_dir, "flashproxy-reg-http.py")]
spec = format_addr((None, options.remote_addr[1]))
- command = ["./flashproxy-reg-http.py"]
if options.facilitator_addr is None:
log(u"Registering \"%s\"." % spec)
else:
More information about the tor-commits
mailing list