1. Python CFFI
  2. Untitled project
  3. cffi

Source

cffi / cffi / ffiplatform.py

The branch 'release-0.2' does not exist.
Diff from to

File cffi/ffiplatform.py

 def compile(tmpdir, ext):
     """Compile a C extension module using distutils."""
 
+    # Turn the 'ext.sources' into absolute paths, because we're going to
+    # do chdir().  In the common case where the path is precisely where
+    # we're going to chdir(), then replace it with a pathless copy.
+    for i, src in enumerate(ext.sources):
+        src = os.path.abspath(src)
+        if os.path.samefile(os.path.dirname(src), tmpdir):
+            src = os.path.basename(src)
+        ext.sources[i] = src
+
     saved_environ = os.environ.copy()
     saved_path = os.getcwd()
     try: