Skip to content

Commit ad117be

Browse files
authored
Use platform.uname instead of os.uname (kivy#2857)
Advantages: - Works cross platform, not just Unix. - Is a namedtuple, so can use meaningful fieldnames. Also snuck in correction to typo in Readme which doesn't warrant its own review.
1 parent f824d0e commit ad117be

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ to install and begin creating APKs and AABs.
3939

4040
(for the develop branch: `pip install git+https://github.com/kivy/python-for-android.git`)
4141

42-
Test that the install works with:
42+
Test that theinstall works with:
4343

4444
p4a --version
4545

pythonforandroid/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import contextlib
22
from os.path import exists, join
3-
from os import getcwd, chdir, makedirs, walk, uname
3+
from os import getcwd, chdir, makedirs, walk
4+
from platform import uname
45
import shutil
56
from fnmatch import fnmatch
67
from tempfile import mkdtemp
78
from pythonforandroid.logger import (logger, Err_Fore, error, info)
89

910

1011
build_platform = '{system}-{machine}'.format(
11-
system=uname()[0], machine=uname()[-1]).lower()
12+
system=uname().system, machine=uname().machine.lower())
1213
"""the build platform in the format `system-machine`. We use
1314
this string to define the right build system when compiling some recipes or
1415
to get the right path for clang compiler"""

0 commit comments

Comments
 (0)