diff --git a/pex/variables.py b/pex/variables.py index 9b3fc6199..af70d1ed7 100644 --- a/pex/variables.py +++ b/pex/variables.py @@ -5,6 +5,7 @@ # checkstyle: noqa import os +import sys from contextlib import contextmanager from .common import die @@ -47,7 +48,7 @@ def set(self, variable, value): def _from_rc(self, rc): ret_vars = {} - for filename in [rc, '.pexrc']: + for filename in [rc, os.path.join(os.path.dirname(sys.argv[0]), '.pexrc')]: try: with open(os.path.expanduser(filename)) as fh: ret_vars.update(dict(map(lambda x: x.strip().split('='), fh))) @@ -55,7 +56,6 @@ def _from_rc(self, rc): continue return ret_vars - def _get_bool(self, variable, default=False): value = self._environ.get(variable) if value is not None: