Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e61156

Browse files
committed
Fix __enter__
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent3e99cc5 commit4e61156

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎bpython/filelock.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def release(self):
5353

5454
def__enter__(self):
5555
self.acquire()
56+
returnself
5657

5758
def__exit__(self,*args):
5859
ifself.locked:
@@ -81,7 +82,6 @@ def acquire(self):
8182
exceptIOErrorase:
8283
ife.errno!=errno.ENOLCK:
8384
raisee
84-
returnself
8585

8686
defrelease(self):
8787
fcntl.flock(self.fd,fcntl.LOCK_UN)
@@ -98,7 +98,6 @@ def __init__(self, fd, mode=None):
9898
defacquire(self):
9999
msvcrt.locking(self.fd,msvcrt.LK_NBLCK,1)
100100
self.locked=True
101-
returnself
102101

103102
defrelease(self):
104103
msvcrt.locking(self.fd,msvcrt.LK_UNLCK,1)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp