Skip to content

Commit 46a05ca

Browse files
committed
[dist] Remove the kwarg ndk_api from get_distribution
Because we already set it in `Context`
1 parent 703dcc0 commit 46a05ca

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

pythonforandroid/distribution.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def __repr__(self):
4444

4545
@classmethod
4646
def get_distribution(cls, ctx, name=None, recipes=[],
47-
ndk_api=None,
4847
force_build=False,
4948
extra_dist_dirs=[],
5049
require_perfect_match=False,
@@ -93,9 +92,7 @@ def get_distribution(cls, ctx, name=None, recipes=[],
9392
# 1) Check if any existing dists meet the requirements
9493
_possible_dists = []
9594
for dist in possible_dists:
96-
if (
97-
ndk_api is not None and dist.ndk_api != ndk_api
98-
) or dist.ndk_api is None:
95+
if (dist.ndk_api != ctx.ndk_api) or dist.ndk_api is None:
9996
continue
10097
for recipe in recipes:
10198
if recipe not in dist.recipes:
@@ -115,7 +112,7 @@ def get_distribution(cls, ctx, name=None, recipes=[],
115112
for dist in possible_dists:
116113
if force_build:
117114
continue
118-
if ndk_api is not None and dist.ndk_api != ndk_api:
115+
if ctx.ndk_api is not None and dist.ndk_api != ctx.ndk_api:
119116
continue
120117
if (set(dist.recipes) == set(recipes) or
121118
(set(recipes).issubset(set(dist.recipes)) and
@@ -136,7 +133,7 @@ def get_distribution(cls, ctx, name=None, recipes=[],
136133
'with this name already exists and has either incompatible recipes '
137134
'({dist_recipes}) or NDK API {dist_ndk_api}'.format(
138135
name=name,
139-
req_ndk_api=ndk_api,
136+
req_ndk_api=ctx.ndk_api,
140137
dist_ndk_api=name_match_dist.ndk_api,
141138
req_recipes=', '.join(recipes),
142139
dist_recipes=', '.join(name_match_dist.recipes)))

pythonforandroid/toolchain.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def dist_from_args(ctx, args):
163163
ctx,
164164
name=args.dist_name,
165165
recipes=split_argument_list(args.requirements),
166-
ndk_api=args.ndk_api,
167166
force_build=args.force_build,
168167
require_perfect_match=args.require_perfect_match,
169168
allow_replace_dist=args.allow_replace_dist)

0 commit comments

Comments
 (0)