Skip to content

Conversation

@fieliapm
Copy link
Contributor

@fieliapm fieliapm commented Aug 25, 2016

In master branch, flask_mongoengine/connection.py, line 265:

if conn_setting.pop('replicaset', None): resolved['replicaSet'] = conn_setting.pop('replicaset', None) 

what is f***ing going on lol

Because dict.pop() will return and also remove specific key value
pair from dict, so we cannot do dict.pop() twice.
Actually this code should be:

replica_set = conn_setting.pop('replicaset', None) if replica_set: resolved['replicaSet'] = replica_set 
In master branch, flask_mongoengine/connection.py, line 265: if conn_setting.pop('replicaset', None): resolved['replicaSet'] = conn_setting.pop('replicaset', None) what is f***ing going on lol Because dict.pop() will return and also remove specific key value pair from dict, so we cannot do dict.pop() twice. Actually this code should be: replica_set = conn_setting.pop('replicaset', None) if replica_set: resolved['replicaSet'] = replica_set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants