Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp_implementation or pure python #229

Closed
NarsuAltan opened this issue Mar 5, 2015 · 3 comments
Closed

cpp_implementation or pure python #229

NarsuAltan opened this issue Mar 5, 2015 · 3 comments

Comments

@NarsuAltan
Copy link

how do i determine whether i'm running my own project under cpp_implementation or pure python environment?

@liujisi
Copy link
Contributor

liujisi commented Mar 5, 2015

@haberman

@llchan
Copy link

llchan commented Mar 12, 2015

I think this is discouraged and there may be better ways, but I've done this in the past:

import google.protobuf.internal.api_implementation
assert google.protobuf.internal.api_implementation.Type() == 'cpp'
assert google.protobuf.internal.api_implementation.Version() == 2

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jan 20, 2016

To use the cpp implementation, you need to specify some environment variables explicitly. If you don't know about it, you are probably using the pure python version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants