Skip to content

Commit f97aea6

Browse files
mdesmetebyhr
authored andcommitted
Make defensive copy of reference types
1 parent 3092c4d commit f97aea6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

trino/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ def __init__(
119119
self._catalog = catalog
120120
self._schema = schema
121121
self._source = source
122-
self._properties = properties or {}
123-
self._headers = headers or {}
122+
self._properties = properties.copy() if properties is not None else {}
123+
self._headers = headers.copy() if headers is not None else {}
124124
self._transaction_id = transaction_id
125125
self._extra_credential = extra_credential
126-
self._client_tags = client_tags
127-
self._roles = roles or {}
126+
self._client_tags = client_tags.copy() if client_tags is not None else list()
127+
self._roles = roles.copy() if roles is not None else {}
128128
self._prepared_statements: Dict[str, str] = {}
129129
self._object_lock = threading.Lock()
130130

0 commit comments

Comments
 (0)