瀏覽代碼

Replace use of dict.has_key with `key in dict`

Alex Gaynor 11 年之前
父節點
當前提交
ac17525039
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      docs/_ext/djangodocs.py

+ 2 - 2
docs/_ext/djangodocs.py

@@ -99,11 +99,11 @@ def visit_snippet(self, node):
     linenos = node.rawsource.count('\n') >= self.highlightlinenothreshold - 1
     fname = node['filename']
     highlight_args = node.get('highlight_args', {})
-    if node.has_key('language'):
+    if 'language' in node:
         # code-block directives
         lang = node['language']
         highlight_args['force'] = True
-    if node.has_key('linenos'):
+    if 'linenos' in node:
         linenos = node['linenos']
 
     def warner(msg):