Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/common.py @ 36648:6585ac350fd9
py3: make os.curdir a bytes
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Mar 2018 12:36:05 -0500 |
parents | 052351e3e1cd |
children | ffa3026d4196 |
comparison
equal
deleted
inserted
replaced
36647:052351e3e1cd | 36648:6585ac350fd9 |
---|---|
136 | 136 |
137 def ispathsafe(path): | 137 def ispathsafe(path): |
138 """Determine if a path is safe to use for filesystem access.""" | 138 """Determine if a path is safe to use for filesystem access.""" |
139 parts = path.split('/') | 139 parts = path.split('/') |
140 for part in parts: | 140 for part in parts: |
141 if (part in ('', os.curdir, pycompat.ospardir) or | 141 if (part in ('', pycompat.oscurdir, pycompat.ospardir) or |
142 pycompat.ossep in part or | 142 pycompat.ossep in part or |
143 pycompat.osaltsep is not None and pycompat.osaltsep in part): | 143 pycompat.osaltsep is not None and pycompat.osaltsep in part): |
144 return False | 144 return False |
145 | 145 |
146 return True | 146 return True |