wbond / oscrypto

Compiler-free Python crypto library backed by the OS, supporting CPython and PyPy
MIT License
318 stars 71 forks source link

Bug fix. #27

Closed pbryan closed 3 years ago

pbryan commented 6 years ago

The imp stuff isn't working for me. Nevertheless, this is a bug I found in my importlib branch, and sending this PR to correct it in your branch.

wbond commented 6 years ago

I'd say we'll need some sort of test case to make sure this is working. I'm not okay with dropping 2.6 support at this point, so if we can't come up with a solution that works for that, I think the implementation will probably have to just live in the fork.

pbryan commented 6 years ago

I see a couple of solutions for 2.6:

  1. Require importlib to be present, which is specifically available in PyPi for 2.6. The original PR was written that way; will work with >= 2.7 out of the box, but will require you to include importlib on 2.6. See https://pypi.org/project/importlib/.

  2. Disable custom-backend if you're on 2.6. This seems reasonable given right now, there is no custom-backend capability.

What are your thoughts on how to create a meaningful test case? I can certainly write tests to make calls to change the backend, but to fully test functionality, we'd need a completely different backend implementation, and exercise all of the existing test cases.