Skip to content

Commit e08044f

Browse files
authored
python/psycopg2: fix broken tests (#37)
Skips using url_quote if the input is neither a string nor bytes.
1 parent 401f2e8 commit e08044f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • python/sqlcommenter-python/google/cloud/sqlcommenter

python/sqlcommenter-python/google/cloud/sqlcommenter/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def generate_sql_comment(**meta):
4343

4444

4545
def url_quote(s):
46+
if not isinstance(s, (str, bytes)):
47+
return s
4648
quoted = url_quote_fn(s)
4749
# Since SQL uses '%' as a keyword, '%' is a by-product of url quoting
4850
# e.g. foo,bar --> foo%2Cbar

0 commit comments

Comments
 (0)