summaryrefslogtreecommitdiff
path: root/cffi/verifier.py
diff options
context:
space:
mode:
authormalthe <devnull@localhost>2014-09-02 14:07:23 +0200
committermalthe <devnull@localhost>2014-09-02 14:07:23 +0200
commit29ae2bc486154245ebc2fb640b76e8eb24de72bb (patch)
treee690d6c7d016a6198bdbf6dac1a8637a2ddef83a /cffi/verifier.py
parent42a5c090fb54f8d29e8bad918bef18934672d3cd (diff)
downloadcffi-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.py2
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