Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc0574cd

Browse files
committed
hstore_plpython: Support tests on Python 2.3
Python 2.3 does not have the sorted() function, so do it the long way.
1 parentad8d6d0 commitc0574cd

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

‎contrib/hstore_plpython/expected/hstore_plpython.out

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ LANGUAGE plpythonu
66
TRANSFORM FOR TYPE hstore
77
AS $$
88
assert isinstance(val, dict)
9-
plpy.info(sorted(val.items()))
9+
i = val.items()
10+
i.sort()
11+
plpy.info(i)
1012
return len(val)
1113
$$;
1214
SELECT test1('aa=>bb, cc=>NULL'::hstore);
@@ -23,7 +25,9 @@ LANGUAGE plpython2u
2325
TRANSFORM FOR TYPE hstore
2426
AS $$
2527
assert isinstance(val, dict)
26-
plpy.info(sorted(val.items()))
28+
i = val.items()
29+
i.sort()
30+
plpy.info(i)
2731
return len(val)
2832
$$;
2933
SELECT test1n('aa=>bb, cc=>NULL'::hstore);

‎contrib/hstore_plpython/sql/hstore_plpython.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ LANGUAGE plpythonu
88
TRANSFORM FOR TYPE hstore
99
AS $$
1010
assert isinstance(val, dict)
11-
plpy.info(sorted(val.items()))
11+
i=val.items()
12+
i.sort()
13+
plpy.info(i)
1214
return len(val)
1315
$$;
1416

@@ -21,7 +23,9 @@ LANGUAGE plpython2u
2123
TRANSFORM FOR TYPE hstore
2224
AS $$
2325
assert isinstance(val, dict)
24-
plpy.info(sorted(val.items()))
26+
i=val.items()
27+
i.sort()
28+
plpy.info(i)
2529
return len(val)
2630
$$;
2731

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp