Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-06-03 16:06:44 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-06-03 16:12:07 +0300
commit5115fb0172c3ae42f326ed7c50e2aa10917dfb94 (patch)
treef8fe1e0a3db0126fc58c2dc132e6b191f9021eec /sphinx/util/png.py
parentb5276b3965388e7b7264a42d1a442b8c734b1877 (diff)
Migrate to py3 style type annotation: sphinx.util.png
Diffstat (limited to 'sphinx/util/png.py')
-rw-r--r--sphinx/util/png.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/sphinx/util/png.py b/sphinx/util/png.py
index 2fb97a901..911547db6 100644
--- a/sphinx/util/png.py
+++ b/sphinx/util/png.py
@@ -20,8 +20,7 @@ DEPTH_CHUNK_START = b'tEXtDepth\x00'
IEND_CHUNK = b'\x00\x00\x00\x00IEND\xAE\x42\x60\x82'
-def read_png_depth(filename):
- # type: (str) -> int
+def read_png_depth(filename: str) -> int:
"""Read the special tEXt chunk indicating the depth from a PNG file."""
with open(filename, 'rb') as f:
f.seek(- (LEN_IEND + LEN_DEPTH), 2)
@@ -33,8 +32,7 @@ def read_png_depth(filename):
return struct.unpack('!i', depthchunk[14:18])[0]
-def write_png_depth(filename, depth):
- # type: (str, int) -> None
+def write_png_depth(filename: str, depth: int) -> None:
"""Write the special tEXt chunk indicating the depth to a PNG file.
The chunk is placed immediately before the special IEND chunk.