summaryrefslogtreecommitdiff
path: root/parsers/rst/roles.py
diff options
context:
space:
mode:
Diffstat (limited to 'parsers/rst/roles.py')
-rw-r--r--parsers/rst/roles.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/parsers/rst/roles.py b/parsers/rst/roles.py
index 1da1395e9..062d53e50 100644
--- a/parsers/rst/roles.py
+++ b/parsers/rst/roles.py
@@ -101,7 +101,7 @@ def role(role_name, language_module, lineno, reporter):
messages = []
msg_text = []
- if _roles.has_key(normname):
+ if normname in _roles:
return _roles[normname], messages
if role_name:
@@ -135,7 +135,7 @@ def role(role_name, language_module, lineno, reporter):
messages.append(message)
# Look the role up in the registry, and return it.
- if _role_registry.has_key(canonicalname):
+ if canonicalname in _role_registry:
role_fn = _role_registry[canonicalname]
register_local_role(normname, role_fn)
return role_fn, messages
@@ -171,7 +171,7 @@ def set_implicit_options(role_fn):
"""
if not hasattr(role_fn, 'options') or role_fn.options is None:
role_fn.options = {'class': directives.class_option}
- elif not role_fn.options.has_key('class'):
+ elif 'class' not in role_fn.options:
role_fn.options['class'] = directives.class_option
def register_generic_role(canonical_name, node_class):
@@ -294,7 +294,7 @@ def rfc_reference_role(role, rawtext, text, lineno, inliner,
register_canonical_role('rfc-reference', rfc_reference_role)
def raw_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
- if not options.has_key('format'):
+ if 'format' not in options:
msg = inliner.reporter.error(
'No format (Writer name) is associated with this role: "%s".\n'
'The "raw" role cannot be used directly.\n'
@@ -340,7 +340,7 @@ def set_classes(options):
Auxiliary function to set options['classes'] and delete
options['class'].
"""
- if options.has_key('class'):
- assert not options.has_key('classes')
+ if 'class' in options:
+ assert 'classes' not in options
options['classes'] = options['class']
del options['class']