Browse Source

Merge pull request #618 from stepshal/comparison

Comparison to None should be 'if cond is not None:'
Adam Tauber 8 years ago
parent
commit
3fd405dcd3
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      utils/fetch_currencies.py

+ 2
- 2
utils/fetch_currencies.py View File

@@ -84,7 +84,7 @@ def parse_currency(data):
84 84
         labels = data.get('labels', {})
85 85
         for language in languages:
86 86
             name = labels.get(language, {}).get('value', None)
87
-            if name != None:
87
+            if name is not None:
88 88
                 add_currency_name(name, iso4217)
89 89
                 add_currency_label(name, iso4217, language)
90 90
 
@@ -126,7 +126,7 @@ def wdq_query(query):
126 126
     jsonresponse = json.loads(htmlresponse.content)
127 127
     qlist = map(add_q, jsonresponse.get('items', {}))
128 128
     error = jsonresponse.get('status', {}).get('error', None)
129
-    if error != None and error != 'OK':
129
+    if error is not None and error != 'OK':
130 130
         print "error for query '" + query + "' :" + error
131 131
 
132 132
     fetch_data_batch(qlist)