[PATCH 06 of 10 logilab-database] [fix] badly named variable (variable -> v)

Laurent Peuch cortex at worlddomination.be
Fri Apr 3 09:14:14 CEST 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1585790475 -7200
#      Thu Apr 02 03:21:15 2020 +0200
# Node ID 9895c9cf8d14b477b1a8efb6908e47389ca858ac
# Parent  ecc36a45fb84b3ed5629003d5a748d04e24a327f
# Available At https://hg.logilab.org/users/lpeuch/logilab-database
#              hg pull https://hg.logilab.org/users/lpeuch/logilab-database -r 9895c9cf8d14
# EXP-Topic good-practice-modernisation
[fix] badly named variable (variable -> v)

diff --git a/logilab/database/sqlserver.py b/logilab/database/sqlserver.py
--- a/logilab/database/sqlserver.py
+++ b/logilab/database/sqlserver.py
@@ -214,9 +214,7 @@ class _BaseSqlServerAdapter(db.DBAPIAdap
             # may occurs on constant selection for instance (e.g. SELECT 'hop')
             # with postgresql at least
             transform = (
-                lambda v: unicode(value, encoding, "replace")
-                if isinstance(v, str)
-                else v
+                lambda v: (str(v, encoding, "replace")) if isinstance(v, str) else v
             )
         return transform
 



More information about the cubicweb-devel mailing list