Add Python3 type annotation to cherry-picked #6310 for 2.2.0 release

This commit is contained in:
jfbu 2019-08-01 17:39:03 +02:00
parent 548d329f35
commit 2d5d290cd4

View File

@ -91,8 +91,7 @@ depthsvg_re = re.compile(br'.*, depth=(.*)pt')
depthsvgcomment_re = re.compile(r'<!-- DEPTH=(-?\d+) -->')
def read_svg_depth(filename):
# type: (str) -> int
def read_svg_depth(filename: str) -> int:
"""Read the depth from comment at last line of SVG file
"""
with open(filename, 'r') as f:
@ -105,8 +104,7 @@ def read_svg_depth(filename):
return None
def write_svg_depth(filename, depth):
# type: (str, int) -> None
def write_svg_depth(filename: str, depth:int) -> None:
"""Write the depth to SVG file as a comment at end of file
"""
with open(filename, 'a') as f: