[Pkg-privacy-commits] [obfsproxy] 167/353: Replacement for __file__ under py2exe.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit ba6098306ca2f5742b1eef6a226d2db53d81ab71
Author: David Fifield <david at bamsoftware.com>
Date:   Thu May 30 11:25:20 2013 -0700

    Replacement for __file__ under py2exe.
    
    See #8943.
---
 bin/obfsproxy | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/obfsproxy b/bin/obfsproxy
index a716b18..5d929c3 100755
--- a/bin/obfsproxy
+++ b/bin/obfsproxy
@@ -3,7 +3,11 @@
 import sys, os
 
 # Forcerfully add root directory of the project to our path.
-dir_of_executable = os.path.dirname(__file__)
+# http://www.py2exe.org/index.cgi/WhereAmI
+if hasattr(sys, "frozen"):
+    dir_of_executable = os.path.dirname(sys.executable)
+else:
+    dir_of_executable = os.path.dirname(__file__)
 path_to_project_root = os.path.abspath(os.path.join(dir_of_executable, '..'))
 
 sys.path.insert(0, path_to_project_root)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list