MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / _escape_args

Method _escape_args

pymysql/cursors.py:106–114  ·  view source on GitHub ↗
(self, args, conn)

Source from the content-addressed store, hash-verified

104 return self._nextset(False)
105
106 def _escape_args(self, args, conn):
107 if isinstance(args, (tuple, list)):
108 return tuple(conn.literal(arg) for arg in args)
109 elif isinstance(args, dict):
110 return {key: conn.literal(val) for (key, val) in args.items()}
111 else:
112 # If it's not a dictionary let's try escaping it anyways.
113 # Worst case it will throw a Value error
114 return conn.escape(args)
115
116 def mogrify(self, query, args=None):
117 """

Callers 1

mogrifyMethod · 0.95

Calls 2

literalMethod · 0.80
escapeMethod · 0.80

Tested by

no test coverage detected