summaryrefslogtreecommitdiff
path: root/cffi
diff options
context:
space:
mode:
Diffstat (limited to 'cffi')
-rw-r--r--cffi/_embedding.h3
-rw-r--r--cffi/recompiler.py5
2 files changed, 4 insertions, 4 deletions
diff --git a/cffi/_embedding.h b/cffi/_embedding.h
index e863d85..4a42cbb 100644
--- a/cffi/_embedding.h
+++ b/cffi/_embedding.h
@@ -22,7 +22,8 @@ extern "C" {
* _cffi_call_python_org, which on CPython is actually part of the
_cffi_exports[] array, is the function pointer copied from
- _cffi_backend.
+ _cffi_backend. If _cffi_start_python() fails, then this is set
+ to NULL; otherwise, it should never be NULL.
After initialization is complete, both are equal. However, the
first one remains equal to &_cffi_start_and_call_python until the
diff --git a/cffi/recompiler.py b/cffi/recompiler.py
index 86b37d7..16a7078 100644
--- a/cffi/recompiler.py
+++ b/cffi/recompiler.py
@@ -406,9 +406,8 @@ class Recompiler:
else:
prnt(' NULL, /* no includes */')
prnt(' %d, /* num_types */' % (len(self.cffi_types),))
- flags = 0
- if self._num_externpy:
- flags |= 1 # set to mean that we use extern "Python"
+ # set 'flags' to 1 in embedding mode, 0 otherwise
+ flags = int(self.ffi._embedding is not None)
prnt(' %d, /* flags */' % flags)
prnt('};')
prnt()