Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e14175

Browse files
committed
ruff: pyupgrade to 3.8
ruff check --target-version py38 --select UP --fix .
1 parentfd4f032 commit1e14175

File tree

56 files changed

+39
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+39
-97
lines changed

‎debug-info.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__importprint_function,unicode_literals
21

32
importplatform
43
importsys

‎doc/conf.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
32
#
43
# html5lib documentation build configuration file, created by
54
# sphinx-quickstart on Wed May 8 00:04:49 2013.
@@ -100,7 +99,7 @@
10099
}
101100

102101

103-
classCExtMock(object):
102+
classCExtMock:
104103
"""Required for autodoc on readthedocs.org where you cannot build C extensions."""
105104
def__init__(self,*args,**kwargs):
106105
pass

‎html5lib/__init__.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* :func:`~.serializer.serialize`
2121
"""
2222

23-
from __future__importabsolute_import,division,unicode_literals
2423

2524
from .html5parserimportHTMLParser,parse,parseFragment
2625
from .treebuildersimportgetTreeBuilder

‎html5lib/_ihatexml.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__importabsolute_import,division,unicode_literals
21

32
importre
43
importwarnings
@@ -181,7 +180,7 @@ def escapeRegexp(string):
181180
nonPubidCharRegexp=re.compile("[^\x20\x0D\x0Aa-zA-Z0-9\\-'()+,./:=?;!*#@$_%]")
182181

183182

184-
classInfosetFilter(object):
183+
classInfosetFilter:
185184
replacementRegexp=re.compile(r"U[\dA-F]{5,5}")
186185

187186
def__init__(self,

‎html5lib/_inputstream.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__importabsolute_import,division,unicode_literals
21

32
fromsiximporttext_type
43
fromsix.movesimporthttp_client,urllib
@@ -48,7 +47,7 @@
4847
charsUntilRegEx= {}
4948

5049

51-
classBufferedStream(object):
50+
classBufferedStream:
5251
"""Buffering for streams that do not have buffering of their own
5352
5453
The buffer is implemented as a list of chunks on the assumption that
@@ -145,7 +144,7 @@ def HTMLInputStream(source, **kwargs):
145144
returnHTMLBinaryInputStream(source,**kwargs)
146145

147146

148-
classHTMLUnicodeInputStream(object):
147+
classHTMLUnicodeInputStream:
149148
"""Provides a unicode stream of characters to the HTMLTokenizer.
150149
151150
This class takes care of character encoding and removing or replacing
@@ -673,7 +672,7 @@ def jumpTo(self, bytes):
673672
returnTrue
674673

675674

676-
classEncodingParser(object):
675+
classEncodingParser:
677676
"""Mini parser for detecting character encoding from meta elements"""
678677

679678
def__init__(self,data):
@@ -861,7 +860,7 @@ def getAttribute(self):
861860
attrValue.append(c)
862861

863862

864-
classContentAttrParser(object):
863+
classContentAttrParser:
865864
def__init__(self,data):
866865
assertisinstance(data,bytes)
867866
self.data=data

‎html5lib/_tokenizer.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__importabsolute_import,division,unicode_literals
21

32
fromsiximportunichraschr
43

@@ -24,7 +23,7 @@
2423
attributeMap=OrderedDict
2524

2625

27-
classHTMLTokenizer(object):
26+
classHTMLTokenizer:
2827
""" This class takes care of tokenizing HTML.
2928
3029
* self.currentToken

‎html5lib/_trie/__init__.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__importabsolute_import,division,unicode_literals
21

32
from .pyimportTrie
43

‎html5lib/_trie/_base.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from __future__importabsolute_import,division,unicode_literals
21

32
try:
43
fromcollections.abcimportMapping
54
exceptImportError:# Python 2.7
6-
fromcollectionsimportMapping
5+
fromcollections.abcimportMapping
76

87

98
classTrie(Mapping):

‎html5lib/_trie/py.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__importabsolute_import,division,unicode_literals
21
fromsiximporttext_type
32

43
frombisectimportbisect_left

‎html5lib/_utils.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
from __future__importabsolute_import,division,unicode_literals
21

32
fromtypesimportModuleType
43

54
try:
65
fromcollections.abcimportMapping
76
exceptImportError:
8-
fromcollectionsimportMapping
7+
fromcollections.abcimportMapping
98

109
fromsiximporttext_type,PY3
1110

1211
ifPY3:
1312
importxml.etree.ElementTreeasdefault_etree
1413
else:
1514
try:
16-
importxml.etree.cElementTreeasdefault_etree
15+
importxml.etree.ElementTreeasdefault_etree
1716
exceptImportError:
1817
importxml.etree.ElementTreeasdefault_etree
1918

@@ -122,7 +121,7 @@ def moduleFactoryFactory(factory):
122121
moduleCache= {}
123122

124123
defmoduleFactory(baseModule,*args,**kwargs):
125-
ifisinstance(ModuleType.__name__,type("")):
124+
ifisinstance(ModuleType.__name__,str):
126125
name="_%s_factory"%baseModule.__name__
127126
else:
128127
name=b"_%s_factory"%baseModule.__name__

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp