Replace use of dict.has_key with `key in dict`
This commit is contained in:
parent
bb5ab908cc
commit
ac17525039
|
@ -99,11 +99,11 @@ def visit_snippet(self, node):
|
||||||
linenos = node.rawsource.count('\n') >= self.highlightlinenothreshold - 1
|
linenos = node.rawsource.count('\n') >= self.highlightlinenothreshold - 1
|
||||||
fname = node['filename']
|
fname = node['filename']
|
||||||
highlight_args = node.get('highlight_args', {})
|
highlight_args = node.get('highlight_args', {})
|
||||||
if node.has_key('language'):
|
if 'language' in node:
|
||||||
# code-block directives
|
# code-block directives
|
||||||
lang = node['language']
|
lang = node['language']
|
||||||
highlight_args['force'] = True
|
highlight_args['force'] = True
|
||||||
if node.has_key('linenos'):
|
if 'linenos' in node:
|
||||||
linenos = node['linenos']
|
linenos = node['linenos']
|
||||||
|
|
||||||
def warner(msg):
|
def warner(msg):
|
||||||
|
|
Loading…
Reference in New Issue