summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpc/server.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-07-19 17:36:31 (GMT)
committerGitHub <noreply@github.com>2025-07-19 17:36:31 (GMT)
commit4606b4089d727ea879e6233ec4a366fffcb28fa1 (patch)
tree789e3ba71a43bbdae3d3176ea6e0e768b92d61ee /Lib/xmlrpc/server.py
parentf8af7cb7231bdb4ae7137c690da4e3903d0ce5f9 (diff)
downloadcpython-4606b4089d727ea879e6233ec4a366fffcb28fa1.zip
cpython-4606b4089d727ea879e6233ec4a366fffcb28fa1.tar.gz
cpython-4606b4089d727ea879e6233ec4a366fffcb28fa1.tar.bz2
[3.14] gh-136839: Refactor simple dict.update calls (GH-136811) (#136840)
gh-136839: Refactor simple dict.update calls (GH-136811) Refactor simple dict.update calls This commit refactors simple `dict.update({key: value})` calls which can be done via `dict[key] = value` instead. I found those cases with the [semgrep](https://semgrep.dev/) tool: ``` $ semgrep --lang python --pattern '$DICT.update({$A: ...})' ┌─────────────────┐ │ 5 Code Findings │ └─────────────────┘ Lib/dataclasses.py 1268┆ slots.update({slot: doc}) Lib/multiprocessing/resource_tracker.py 50┆ _CLEANUP_FUNCS.update({ 51┆ 'semaphore': _multiprocessing.sem_unlink, 52┆ }) ⋮┆---------------------------------------- 53┆ _CLEANUP_FUNCS.update({ 54┆ 'shared_memory': _posixshmem.shm_unlink, 55┆ }) Lib/tkinter/scrolledtext.py 26┆ kw.update({'yscrollcommand': self.vbar.set}) Lib/xmlrpc/server.py 242┆ self.funcs.update({'system.multicall' : self.system_multicall}) ``` (cherry picked from commit 69ea1b3a8f45fec46add3272ad47f14ff5321ae8) Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Diffstat (limited to 'Lib/xmlrpc/server.py')
-rw-r--r--Lib/xmlrpc/server.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py
index 8130c73..3e68711 100644
--- a/Lib/xmlrpc/server.py
+++ b/Lib/xmlrpc/server.py
@@ -239,7 +239,7 @@ class SimpleXMLRPCDispatcher:
see http://www.xmlrpc.com/discuss/msgReader$1208"""
- self.funcs.update({'system.multicall' : self.system_multicall})
+ self.funcs['system.multicall'] = self.system_multicall
def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
"""Dispatches an XML-RPC method from marshalled (XML) data.