Skip to content

Commit f0b322a

Browse files
committed
Upgrade Python syntax with pyupgrade --py36-plus
1 parent 1bda3b6 commit f0b322a

File tree

8 files changed

+13
-18
lines changed

8 files changed

+13
-18
lines changed

Diff for: doc/source/conf.py

+4-5
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

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import smmap
1212

1313
if os.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

Diff for: smmap/buf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
__all__ = ["SlidingWindowMapBuffer"]
55

66

7-
class SlidingWindowMapBuffer(object):
7+
class SlidingWindowMapBuffer:
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.

Diff for: smmap/mman.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#}END utilities
1616

1717

18-
class WindowCursor(object):
18+
class WindowCursor:
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-
class StaticWindowMapManager(object):
236+
class StaticWindowMapManager:
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

Diff for: smmap/test/lib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#{ Utilities
1010

11-
class FileCreator(object):
11+
class FileCreator:
1212

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

Diff for: smmap/test/test_buf.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
from .lib import TestBase, FileCreator
42

53
from smmap.mman import (

Diff for: smmap/test/test_mman.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
from .lib import TestBase, FileCreator
42

53
from smmap.mman import (

Diff for: smmap/util.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_64_bit():
3434

3535
#{ Utility Classes
3636

37-
class MapWindow(object):
37+
class MapWindow:
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-
class MapRegion(object):
83+
class MapRegion:
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-
return super(MapRegionList, cls).__new__(cls)
201+
return super().__new__(cls)
202202

203203
def __init__(self, path_or_fd):
204204
self._path_or_fd = path_or_fd

0 commit comments

Comments
 (0)