Skip to content

Commit 10d215e

Browse files
committed
properly reference ".pexrc" as relative to the pex file itself.
1 parent 133bfac commit 10d215e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pex/variables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# checkstyle: noqa
66

77
import os
8+
import sys
89
from contextlib import contextmanager
910

1011
from .common import die
@@ -47,15 +48,14 @@ def set(self, variable, value):
4748

4849
def _from_rc(self, rc):
4950
ret_vars = {}
50-
for filename in [rc, '.pexrc']:
51+
for filename in [rc, os.path.join(os.path.dirname(sys.argv[0]), '.pexrc')]:
5152
try:
5253
with open(os.path.expanduser(filename)) as fh:
5354
ret_vars.update(dict(map(lambda x: x.strip().split('='), fh)))
5455
except IOError:
5556
continue
5657
return ret_vars
5758

58-
5959
def _get_bool(self, variable, default=False):
6060
value = self._environ.get(variable)
6161
if value is not None:

0 commit comments

Comments
 (0)