Fix for PYTHON-479

Fix for https://jira.mongodb.org/browse/PYTHON-479