Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions ddtrace/internal/ipc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from contextlib import contextmanager
import os
import secrets
import tempfile
Expand Down Expand Up @@ -57,9 +56,7 @@ class ReadLock(BaseUnixLock):
class WriteLock(BaseUnixLock):
__acquire_mode__ = fcntl.LOCK_EX

@contextmanager
def open_file(path, mode):
yield unpatched_open(path, mode)
open_file = unpatched_open

except ModuleNotFoundError:
# Availability: Windows
Expand All @@ -78,7 +75,7 @@ def release(self):

ReadLock = WriteLock = BaseWinLock # type: ignore

def open_file(path, mode):
def open_file(path, mode): # type: ignore
import _winapi

# force all modes to be read/write binary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fixes:
- |
Prevent a potential ``ResourceWarning`` in multiprocess scenarios.
Loading