Try to fix tests failing on Python 3.11
This commit is contained in:
parent
7d28d7413f
commit
c6360537e5
@ -265,7 +265,10 @@ as_color(ColorProfile *self, PyObject *val) {
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
Color *ans = PyObject_New(Color, &Color_Type);
|
Color *ans = PyObject_New(Color, &Color_Type);
|
||||||
if (ans) ans->color.rgb = col;
|
if (ans) {
|
||||||
|
ans->color.val = 0;
|
||||||
|
ans->color.rgb = col;
|
||||||
|
}
|
||||||
return (PyObject*)ans;
|
return (PyObject*)ans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ EdgeLiteral = Literal['left', 'top', 'right', 'bottom']
|
|||||||
UnderlineLiteral = Literal['straight', 'double', 'curly', 'dotted', 'dashed']
|
UnderlineLiteral = Literal['straight', 'double', 'curly', 'dotted', 'dashed']
|
||||||
MatchType = Literal['mime', 'ext', 'protocol', 'file', 'path', 'url', 'fragment_matches']
|
MatchType = Literal['mime', 'ext', 'protocol', 'file', 'path', 'url', 'fragment_matches']
|
||||||
PowerlineStyle = Literal['angled', 'slanted', 'round']
|
PowerlineStyle = Literal['angled', 'slanted', 'round']
|
||||||
GRT_a = Literal['t', 'T', 'q', 'p', 'd', 'f', 'a', 'c', 'q']
|
GRT_a = Literal['t', 'T', 'q', 'p', 'd', 'f', 'a', 'c']
|
||||||
GRT_f = Literal[24, 32, 100]
|
GRT_f = Literal[24, 32, 100]
|
||||||
GRT_t = Literal['d', 'f', 't', 's']
|
GRT_t = Literal['d', 'f', 't', 's']
|
||||||
GRT_o = Literal['z']
|
GRT_o = Literal['z']
|
||||||
|
|||||||
@ -443,7 +443,7 @@ class TestDataTypes(BaseTest):
|
|||||||
c.update_ansi_color_table(build_ansi_color_table())
|
c.update_ansi_color_table(build_ansi_color_table())
|
||||||
for i in range(8):
|
for i in range(8):
|
||||||
col = getattr(defaults, f'color{i}')
|
col = getattr(defaults, f'color{i}')
|
||||||
self.assertEqual(c.as_color(i << 8 | 1), col)
|
self.ae(c.as_color(i << 8 | 1), col)
|
||||||
self.ae(c.as_color(255 << 8 | 1), Color(0xee, 0xee, 0xee))
|
self.ae(c.as_color(255 << 8 | 1), Color(0xee, 0xee, 0xee))
|
||||||
|
|
||||||
def test_historybuf(self):
|
def test_historybuf(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user