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

Commitf0b322a

Browse files
committed
Upgrade Python syntax with pyupgrade --py36-plus
1 parent1bda3b6 commitf0b322a

File tree

8 files changed

+13
-18
lines changed

8 files changed

+13
-18
lines changed

‎doc/source/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# smmap documentation build configuration file, created by
43
# sphinx-quickstart on Wed Jun 8 15:14:25 2011.
@@ -38,8 +37,8 @@
3837
master_doc='index'
3938

4039
# General information about the project.
41-
project=u'smmap'
42-
copyright=u'2011, Sebastian Thiel'
40+
project='smmap'
41+
copyright='2011, Sebastian Thiel'
4342

4443
# The version info for the project you're documenting, acts as replacement for
4544
# |version| and |release|, also used in various other places throughout the
@@ -173,8 +172,8 @@
173172
# Grouping the document tree into LaTeX files. List of tuples
174173
# (source start file, target name, title, author, documentclass [howto/manual]).
175174
latex_documents= [
176-
('index','smmap.tex',u'smmap Documentation',
177-
u'Sebastian Thiel','manual'),
175+
('index','smmap.tex','smmap Documentation',
176+
'Sebastian Thiel','manual'),
178177
]
179178

180179
# The name of an image file (relative to this directory) to place at the top of

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
importsmmap
1212

1313
ifos.path.exists("README.md"):
14-
long_description=open('README.md',"r",encoding="utf-8").read().replace('\r\n','\n')
14+
long_description=open('README.md',encoding="utf-8").read().replace('\r\n','\n')
1515
else:
1616
long_description="See https://github.com/gitpython-developers/smmap"
1717

‎smmap/buf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
__all__= ["SlidingWindowMapBuffer"]
55

66

7-
classSlidingWindowMapBuffer(object):
7+
classSlidingWindowMapBuffer:
88

99
"""A buffer like object which allows direct byte-wise object and slicing into
1010
memory of a mapped file. The mapping is controlled by the provided cursor.

‎smmap/mman.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#}END utilities
1616

1717

18-
classWindowCursor(object):
18+
classWindowCursor:
1919

2020
"""
2121
Pointer into the mapped region of the memory manager, keeping the map
@@ -233,7 +233,7 @@ def fd(self):
233233
#} END interface
234234

235235

236-
classStaticWindowMapManager(object):
236+
classStaticWindowMapManager:
237237

238238
"""Provides a manager which will produce single size cursors that are allowed
239239
to always map the whole file.
@@ -486,7 +486,7 @@ class SlidingWindowMapManager(StaticWindowMapManager):
486486

487487
def__init__(self,window_size=-1,max_memory_size=0,max_open_handles=sys.maxsize):
488488
"""Adjusts the default window size to -1"""
489-
super(SlidingWindowMapManager,self).__init__(window_size,max_memory_size,max_open_handles)
489+
super().__init__(window_size,max_memory_size,max_open_handles)
490490

491491
def_obtain_region(self,a,offset,size,flags,is_recursive):
492492
# bisect to find an existing region. The c++ implementation cannot

‎smmap/test/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#{ Utilities
1010

11-
classFileCreator(object):
11+
classFileCreator:
1212

1313
"""A instance which creates a temporary file with a prefix and a given size
1414
and provides this info to the user.

‎smmap/test/test_buf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__importprint_function
2-
31
from .libimportTestBase,FileCreator
42

53
fromsmmap.mmanimport (

‎smmap/test/test_mman.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__importprint_function
2-
31
from .libimportTestBase,FileCreator
42

53
fromsmmap.mmanimport (

‎smmap/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_64_bit():
3434

3535
#{ Utility Classes
3636

37-
classMapWindow(object):
37+
classMapWindow:
3838

3939
"""Utility type which is used to snap windows towards each other, and to adjust their size"""
4040
__slots__= (
@@ -80,7 +80,7 @@ def extend_right_to(self, window, max_size):
8080
self.size=min(self.size+ (window.ofs-self.ofs_end()),max_size)
8181

8282

83-
classMapRegion(object):
83+
classMapRegion:
8484

8585
"""Defines a mapped region of memory, aligned to pagesizes
8686
@@ -198,7 +198,7 @@ class MapRegionList(list):
198198
)
199199

200200
def__new__(cls,path):
201-
returnsuper(MapRegionList,cls).__new__(cls)
201+
returnsuper().__new__(cls)
202202

203203
def__init__(self,path_or_fd):
204204
self._path_or_fd=path_or_fd

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp