8000 Minor cleanups. · matplotlib/mplcairo@0292022 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0292022

Browse files
committed
Minor cleanups.
1 parent ea75c4f commit 0292022

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ext/_feature_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
#include <cairo.h>
77
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 13, 1)
8-
#error "Your version of cairo version is too old."
8+
#error "cairo>=1.13.1 is required."
99
#endif

ext/_mplcairo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ void GraphicsContextRenderer::draw_path_collection(
13951395
fcs_raw(i_mod, 2), fcs_raw(i_mod, 3));
13961396
cache.mask(ctx, path, mtx, draw_func_t::Fill, 0, {}, x, y);
13971397
}
1398-
if (ecs_raw.size()) {
1398+
if (ecs_raw.shape(0)) {
13991399
auto const& i_mod = i % ecs_raw.shape(0);
14001400
cairo_set_source_rgba(
14011401
ctx, ecs_raw(i_mod, 0), ecs_raw(i_mod, 1),

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@ def gen_extension(tmpdir):
102102
return ext
103103

104104

105+
# NOTE: Finding the dlls in libpath is not particularly correct as this really
106+
# specifies paths to .lib import libraries; instead we should use
107+
# ctypes.util.find_library and ask the caller to set PATH if desired.
105108
@functools.lru_cache(1)
106109
def paths_from_link_libpaths():
107110
# "Easy" way to call CommandLineToArgvW...
108111
argv = json.loads(subprocess.check_output(
109112
'"{}" -c "import json, sys; print(json.dumps(sys.argv[1:]))" {}'
110113
.format(sys.executable, os.environ.get("LINK", ""))))
111-
paths = []
112-
for arg in argv:
113-
match = re.fullmatch("(?i)/LIBPATH:(.*)", arg)
114-
if match:
115-
paths.append(Path(match.group(1)))
116-
return paths
114+
return [Path(match[1])
115+
for match in map(re.compile("(?i)/LIBPATH:(.*)").fullmatch, argv)
116+
if match]
117117

118118

119119
class build_ext(setuptools.command.build_ext.build_ext):

0 commit comments

Comments
 (0)
0