Skip to content

Commit

Permalink
Remove values_list compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Jan 23, 2022
1 parent 5f84a82 commit 85f4cd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pony/orm/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import absolute_import, print_function, division
from pony.py23compat import values_list, cmp, \
basestring, unicode, buffer, int_types, builtins, with_metaclass
from pony.py23compat import cmp, basestring, unicode, buffer, int_types, builtins, with_metaclass

import json, re, sys, types, datetime, logging, itertools, warnings, inspect, ast
from operator import attrgetter, itemgetter
Expand Down Expand Up @@ -920,7 +919,7 @@ def insert(database, table_name, returning=None, **kwargs):
cached_sql = sql, adapter
database._insert_cache[query_key] = cached_sql
else: sql, adapter = cached_sql
arguments = adapter(values_list(kwargs)) # order of values same as order of keys
arguments = adapter(list(kwargs.values())) # order of values same as order of keys
if returning is not None:
return database._exec_sql(sql, arguments, returning_id=True, start_transaction=True)
cursor = database._exec_sql(sql, arguments, start_transaction=True)
Expand Down
3 changes: 0 additions & 3 deletions pony/py23compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
def cmp(a, b):
return (a > b) - (a < b)

def values_list(dict):
return list(dict.values())

# Armin's recipe from http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/
def with_metaclass(meta, *bases):
class metaclass(meta):
Expand Down

0 comments on commit 85f4cd1

Please sign in to comment.