diff options
author | malthe <devnull@localhost> | 2014-09-02 14:07:23 +0200 |
---|---|---|
committer | malthe <devnull@localhost> | 2014-09-02 14:07:23 +0200 |
commit | 29ae2bc486154245ebc2fb640b76e8eb24de72bb (patch) | |
tree | e690d6c7d016a6198bdbf6dac1a8637a2ddef83a /cffi/verifier.py | |
parent | 42a5c090fb54f8d29e8bad918bef18934672d3cd (diff) | |
download | cffi-29ae2bc486154245ebc2fb640b76e8eb24de72bb.tar.gz |
Add support for 'CFFI_TMPDIR' environment variable
If set, the value is used as the 'tmpdir' instead of the caller directory's
'__pycache__'.
This allows correct run-time operation when the package source is read-only.
Diffstat (limited to 'cffi/verifier.py')
-rw-r--r-- | cffi/verifier.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cffi/verifier.py b/cffi/verifier.py index ae674de..cb4e0bb 100644 --- a/cffi/verifier.py +++ b/cffi/verifier.py @@ -42,7 +42,7 @@ class Verifier(object): modulename = '_cffi_%s_%s%s%s' % (tag, self._vengine._class_key, k1, k2) suffix = _get_so_suffixes()[0] - self.tmpdir = tmpdir or _caller_dir_pycache() + self.tmpdir = tmpdir or os.environ.get('CFFI_TMPDIR') or _caller_dir_pycache() self.sourcefilename = os.path.join(self.tmpdir, modulename + '.c') self.modulefilename = os.path.join(self.tmpdir, modulename + suffix) self.ext_package = ext_package |