Skip to content

Commit 3fa2280

Browse files
committed
🔥 Remove python2 code from python module
1 parent a25b13c commit 3fa2280

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pythonforandroid/python.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
This module is kind of special because it contains the base classes used to
3-
build our python3 and python2 recipes and his corresponding hostpython recipes.
3+
build our python3 and his corresponding hostpython recipes.
44
'''
55

66
from os.path import dirname, exists, join, isfile
@@ -26,8 +26,7 @@ class GuestPythonRecipe(TargetPythonRecipe):
2626
Class for target python recipes. Sets ctx.python_recipe to point to itself,
2727
so as to know later what kind of Python was built or used.
2828
29-
This base class is used for our main python recipes (python2 and python3)
30-
which shares most of the build process.
29+
This base class is used for our main python3 recipe.
3130
3231
.. versionadded:: 0.6.0
3332
Refactored from the inclement's python3 recipe with a few changes:
@@ -280,10 +279,7 @@ def compile_python_files(self, dir):
280279
longer used...uses .pyc (https://www.python.org/dev/peps/pep-0488)
281280
'''
282281
args = [self.ctx.hostpython]
283-
if self.ctx.python_recipe.name == 'python3':
284-
args += ['-OO', '-m', 'compileall', '-b', '-f', dir]
285-
else:
286-
args += ['-OO', '-m', 'compileall', '-f', dir]
282+
args += ['-OO', '-m', 'compileall', '-b', '-f', dir]
287283
subprocess.call(args)
288284

289285
def create_python_bundle(self, dirn, arch):
@@ -363,7 +359,7 @@ def create_python_bundle(self, dirn, arch):
363359

364360
class HostPythonRecipe(Recipe):
365361
'''
366-
This is the base class for hostpython3 and hostpython2 recipes. This class
362+
This is the base class for hostpython3 recipe. This class
367363
will take care to do all the work to build a hostpython recipe but, be
368364
careful, it is intended to be subclassed because some of the vars needs to
369365
be set:
@@ -376,8 +372,7 @@ class HostPythonRecipe(Recipe):
376372
'''
377373

378374
name = ''
379-
'''The hostpython's recipe name. This should be ``hostpython2`` or
380-
``hostpython3``
375+
'''The hostpython's recipe name. This should be ``hostpython3``
381376
382377
.. warning:: This must be set in inherited class.'''
383378

0 commit comments

Comments
 (0)