mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
all ndk paths in config must be strings
The paths in the config must be strings because they are used in things like env vars where they must be strings. Plus lots of other places in the code assumes they are strings. This is the first step to defining the border of where paths can be pathlib.Path() and where they must be strings.
This commit is contained in:
parent
898624dcac
commit
36d2a8f899
4 changed files with 45 additions and 2 deletions
|
@ -325,12 +325,14 @@ class Build(dict):
|
|||
return f
|
||||
return 'ant'
|
||||
|
||||
def ndk_path(self):
|
||||
"""Return the path to the first configured NDK or an empty string."""
|
||||
def ndk_path(self) -> str:
|
||||
"""Return the path string of the first configured NDK or an empty string."""
|
||||
ndk = self.ndk
|
||||
if isinstance(ndk, list):
|
||||
ndk = self.ndk[0]
|
||||
path = common.config['ndk_paths'].get(ndk)
|
||||
if path and not isinstance(path, str):
|
||||
raise TypeError('NDK path is not string')
|
||||
if path:
|
||||
return path
|
||||
for vsn, path in common.config['ndk_paths'].items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue