aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 559e9286f..35746e651 100644
--- a/setup.py
+++ b/setup.py
@@ -130,6 +130,15 @@ import os
import time
from utils import memoize, has_option, get_python_dict
OPTION_SNAPSHOT_BUILD = has_option("snapshot-build")
+
+# Change the cwd to setup.py's dir.
+try:
+ this_file = __file__
+except NameError:
+ this_file = sys.argv[0]
+this_file = os.path.abspath(this_file)
+if os.path.dirname(this_file):
+ os.chdir(os.path.dirname(this_file))
script_dir = os.getcwd()
@memoize
@@ -346,15 +355,6 @@ if OPTION_ICULIB:
if not OPTION_STANDALONE:
print("--iculib-url option is a no-op option and will be removed soon.")
-# Change the cwd to our source dir
-try:
- this_file = __file__
-except NameError:
- this_file = sys.argv[0]
-this_file = os.path.abspath(this_file)
-if os.path.dirname(this_file):
- os.chdir(os.path.dirname(this_file))
-
def is_debug_python():
return getattr(sys, "gettotalrefcount", None) is not None