summaryrefslogtreecommitdiff
path: root/pygments/lexers/sql.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2020-02-29 15:45:08 +0100
committerGitHub <noreply@github.com>2020-02-29 15:45:08 +0100
commit35544e2fc6eed0ce4a27ec7285aac71ff0ddc473 (patch)
tree4390507bf0d4d5a4596cfc57c575da12f9da40f9 /pygments/lexers/sql.py
parent14fc057d300102d88a07eda5558f238d49dd23f6 (diff)
downloadpygments-git-35544e2fc6eed0ce4a27ec7285aac71ff0ddc473.tar.gz
Remove Python 2 compatibility (#1348)
* Remove Python 2 compatibility * remove 2/3 shims in pygments.util * update setup.py metadata * Remove unneeded object inheritance. * Remove unneeded future imports.
Diffstat (limited to 'pygments/lexers/sql.py')
-rw-r--r--pygments/lexers/sql.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py
index afcaa6d4..0c45b14d 100644
--- a/pygments/lexers/sql.py
+++ b/pygments/lexers/sql.py
@@ -44,7 +44,6 @@ from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, words
from pygments.token import Punctuation, Whitespace, Text, Comment, Operator, \
Keyword, Name, String, Number, Generic
from pygments.lexers import get_lexer_by_name, ClassNotFound
-from pygments.util import iteritems
from pygments.lexers._postgres_builtins import KEYWORDS, DATATYPES, \
PSEUDO_TYPES, PLPGSQL_KEYWORDS
@@ -106,7 +105,7 @@ def language_callback(lexer, match):
yield (match.start(7), String, match.group(7))
-class PostgresBase(object):
+class PostgresBase:
"""Base class for Postgres-related lexers.
This is implemented as a mixin to avoid the Lexer metaclass kicking in.
@@ -212,7 +211,7 @@ class PlPgsqlLexer(PostgresBase, RegexLexer):
mimetypes = ['text/x-plpgsql']
flags = re.IGNORECASE
- tokens = {k: l[:] for (k, l) in iteritems(PostgresLexer.tokens)}
+ tokens = {k: l[:] for (k, l) in PostgresLexer.tokens.items()}
# extend the keywords list
for i, pattern in enumerate(tokens['root']):
@@ -246,7 +245,7 @@ class PsqlRegexLexer(PostgresBase, RegexLexer):
aliases = [] # not public
flags = re.IGNORECASE
- tokens = {k: l[:] for (k, l) in iteritems(PostgresLexer.tokens)}
+ tokens = {k: l[:] for (k, l) in PostgresLexer.tokens.items()}
tokens['root'].append(
(r'\\[^\s]+', Keyword.Pseudo, 'psql-command'))
@@ -271,7 +270,7 @@ re_message = re.compile(
r'FATAL|HINT|DETAIL|CONTEXT|LINE [0-9]+):)(.*?\n)')
-class lookahead(object):
+class lookahead:
"""Wrap an iterator and allow pushing back an item."""
def __init__(self, x):
self.iter = iter(x)