File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -117,9 +117,12 @@ def values_for_enum(gtype):
117
117
g_type_class = gobject_lib .g_type_class_ref (gtype )
118
118
g_enum_class = ffi .cast ('GEnumClass *' , g_type_class )
119
119
120
- # -1 since we always have a "last" member.
121
- return [_to_string (g_enum_class .values [i ].value_nick )
122
- for i in range (g_enum_class .n_values - 1 )]
120
+ result = [_to_string (g_enum_class .values [i ].value_nick )
121
+ for i in range (g_enum_class .n_values )]
122
+ # FIXME(kleisauke): remove after https://github.com/libvips/libvips/pull/4520
123
+ if 'last' in result :
124
+ result .remove ('last' )
125
+ return result
123
126
124
127
125
128
def values_for_flag (gtype ):
@@ -138,10 +141,12 @@ def enum_dict(gtype):
138
141
g_type_class = gobject_lib .g_type_class_ref (gtype )
139
142
g_enum_class = ffi .cast ('GEnumClass *' , g_type_class )
140
143
141
- # -1 since we always have a "last" member.
142
- return {_to_string (g_enum_class .values [i ].value_nick ):
143
- g_enum_class .values [i ].value
144
- for i in range (g_enum_class .n_values - 1 )}
144
+ result = {_to_string (g_enum_class .values [i ].value_nick ):
145
+ g_enum_class .values [i ].value
146
+ for i in range (g_enum_class .n_values )}
147
+ # FIXME(kleisauke): remove after https://github.com/libvips/libvips/pull/4520
148
+ result .pop ('last' , None )
149
+ return result
145
150
146
151
147
152
def flags_dict (gtype ):
You can’t perform that action at this time.
0 commit comments