Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
6f2a57ba
Commit
6f2a57ba
authored
2 years ago
by
Manuel Jacob
Browse files
Options
Downloads
Patches
Plain Diff
py3: catch PermissionError instead of checking errno == EACCES
parent
2e726c93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!168
branching: merge default into stable
,
!158
Python 3 cleanups (part 2)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mercurial/posix.py
+7
-12
7 additions, 12 deletions
mercurial/posix.py
with
7 additions
and
12 deletions
mercurial/posix.py
+
7
−
12
View file @
6f2a57ba
...
...
@@ -302,18 +302,13 @@
try
:
fullpath
=
os
.
path
.
join
(
cachedir
,
target
)
open
(
fullpath
,
b
'
w
'
).
close
()
except
IOError
as
inst
:
# pytype: disable=unsupported-operands
if
inst
[
0
]
==
errno
.
EACCES
:
# pytype: enable=unsupported-operands
# If we can't write to cachedir, just pretend
# that the fs is readonly and by association
# that the fs won't support symlinks. This
# seems like the least dangerous way to avoid
# data loss.
return
False
raise
except
PermissionError
:
# If we can't write to cachedir, just pretend
# that the fs is readonly and by association
# that the fs won't support symlinks. This
# seems like the least dangerous way to avoid
# data loss.
return
False
try
:
os
.
symlink
(
target
,
name
)
if
cachedir
is
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment