@@ -59,18 +59,17 @@ def check(this_file, target, title, titledict):
59
59
60
60
path = posixpath .join (posixpath .dirname (this_file ), target )
61
61
path = posixpath .normpath (path )
62
- real_path = common .slashfix (path )
63
62
64
- if not os .path .exists (real_path ):
63
+ if not os .path .exists (path ):
65
64
return "doesn't exist"
66
65
67
66
if target .endswith ('/' ):
68
67
# A directory.
69
- if not os .path .isdir (real_path ):
68
+ if not os .path .isdir (path ):
70
69
return "not a directory"
71
70
else :
72
71
# A file.
73
- if not os .path .isfile (real_path ):
72
+ if not os .path .isfile (path ):
74
73
return "not a file"
75
74
76
75
if title is not None and title not in titledict [path ]:
@@ -82,7 +81,7 @@ def find_titles(filename):
82
81
"""Read titles of a markdown file and return a list of them."""
83
82
result = []
84
83
85
- with common . slashfix_open (filename , 'r' ) as f :
84
+ with open (filename , 'r' ) as f :
86
85
for line in f :
87
86
if line .startswith ('```' ):
88
87
# it's a code block, let's skip to the end of it to
@@ -103,7 +102,7 @@ def find_links(this_file):
103
102
"""
104
103
result = []
105
104
106
- with common . slashfix_open (this_file , 'r' ) as f :
105
+ with open (this_file , 'r' ) as f :
107
106
for match , lineno in common .find_links (f ):
108
107
target = match .group (2 )
109
108
if '#' in target :
@@ -122,7 +121,7 @@ def find_links(this_file):
122
121
123
122
def get_line (filename , lineno ):
124
123
"""Return the lineno'th line of a file."""
125
- with common . slashfix_open (filename , 'r' ) as f :
124
+ with open (filename , 'r' ) as f :
126
125
for lineno2 , line in enumerate (f , start = 1 ):
127
126
if lineno == lineno2 :
128
127
return line
0 commit comments