Skip to content

Commit 47b1ace

Browse files
committed
Update docs, update error message, pin astroid version to a non-broken version
1 parent 4021ee0 commit 47b1ace

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

buildconfig/stubs/pygame/transform.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def hsl(
463463
def pixelate(
464464
surface: Surface,
465465
pixel_size: int,
466-
dest_surface: Optional[Surface] = None
466+
dest_surface: Optional[Surface] = None,
467467
) -> Surface:
468468
"""Returns a pixelated version of the original surface.
469469

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ requires = [
6060
"sphinx<=8.1.3",
6161
"sphinx-autoapi<=3.3.2",
6262
"pyproject-metadata!=0.9.1",
63+
"astroid<=3.3.8",
6364
]
6465
build-backend = 'mesonpy'
6566

src_c/transform.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ newsurf_fromsurf(SDL_Surface *surf, int width, int height)
137137
/* Copy palette, colorkey, etc info */
138138
if (SDL_ISPIXELFORMAT_INDEXED(PG_SURF_FORMATENUM(surf))) {
139139
SDL_Palette *newsurf_palette = PG_GetSurfacePalette(newsurf);
140-
SDL_Palette *surf_palette = PG_GetSurfacePalette(newsurf);
140+
SDL_Palette *surf_palette = PG_GetSurfacePalette(surf);
141141

142142
if (newsurf_palette == NULL) {
143143
PyErr_SetString(
@@ -4248,13 +4248,13 @@ surf_pixelate(PyObject *self, PyObject *args, PyObject *kwargs)
42484248

42494249
if (testWidth > INT_MAX || testWidth <= 0) {
42504250
PyErr_SetString(PyExc_OverflowError,
4251-
"Cannot scale width outside the range [0, INT_MAX]");
4251+
"Cannot scale width outside the range (0, INT_MAX]");
42524252
return NULL;
42534253
}
42544254

42554255
if (testHeight > INT_MAX || testHeight <= 0) {
42564256
PyErr_SetString(PyExc_OverflowError,
4257-
"Cannot scale height outside the range [0, INT_MAX]");
4257+
"Cannot scale height outside the range (0, INT_MAX]");
42584258
return NULL;
42594259
}
42604260

0 commit comments

Comments
 (0)