@@ -59,18 +59,17 @@ def check(this_file, target, title, titledict):
5959
6060 path = posixpath .join (posixpath .dirname (this_file ), target )
6161 path = posixpath .normpath (path )
62- real_path = common .slashfix (path )
6362
64- if not os .path .exists (real_path ):
63+ if not os .path .exists (path ):
6564 return "doesn't exist"
6665
6766 if target .endswith ('/' ):
6867 # A directory.
69- if not os .path .isdir (real_path ):
68+ if not os .path .isdir (path ):
7069 return "not a directory"
7170 else :
7271 # A file.
73- if not os .path .isfile (real_path ):
72+ if not os .path .isfile (path ):
7473 return "not a file"
7574
7675 if title is not None and title not in titledict [path ]:
@@ -82,7 +81,7 @@ def find_titles(filename):
8281 """Read titles of a markdown file and return a list of them."""
8382 result = []
8483
85- with common . slashfix_open (filename , 'r' ) as f :
84+ with open (filename , 'r' ) as f :
8685 for line in f :
8786 if line .startswith ('```' ):
8887 # it's a code block, let's skip to the end of it to
@@ -103,7 +102,7 @@ def find_links(this_file):
103102 """
104103 result = []
105104
106- with common . slashfix_open (this_file , 'r' ) as f :
105+ with open (this_file , 'r' ) as f :
107106 for match , lineno in common .find_links (f ):
108107 target = match .group (2 )
109108 if '#' in target :
@@ -122,7 +121,7 @@ def find_links(this_file):
122121
123122def get_line (filename , lineno ):
124123 """Return the lineno'th line of a file."""
125- with common . slashfix_open (filename , 'r' ) as f :
124+ with open (filename , 'r' ) as f :
126125 for lineno2 , line in enumerate (f , start = 1 ):
127126 if lineno == lineno2 :
128127 return line
0 commit comments