Skip to content

[WIP/PoC] Attempt to use the fasteners library#114

Closed
dstufft wants to merge 1 commit intopsf:masterfrom
dstufft:fasteners
Closed

[WIP/PoC] Attempt to use the fasteners library#114
dstufft wants to merge 1 commit intopsf:masterfrom
dstufft:fasteners

Conversation

@dstufft
Copy link
Copy Markdown
Contributor

@dstufft dstufft commented Jan 19, 2016

No description provided.


def _lockname(self, name):
if isinstance(self.lock_class, PYLockFileBase):
return self.name
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 'name', not 'self.name'

if isinstance(self.lock_class, PYLockFileBase):
return self.name
else:
return self.name + ".lock"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

with open(name, 'rb') as fh:
return fh.read()
with self.lock_class(self._lockname(name)):
if not os.path.exists(name):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be refactored as a try/except block, instead of testing for path existence?

@kloczek
Copy link
Copy Markdown

kloczek commented Jan 18, 2022

To be able test that PR it would be necessary to modify module metadata to statr require on install time fasteners instead lockfile.
Is it possible to add that part ot the PR as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants