Skip to content

Commit

Permalink
Python 3.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vinzenz authored and pirat89 committed Mar 7, 2022
1 parent 27e29f0 commit d3d81b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions leapp/utils/workarounds/mp.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import os
import multiprocessing.util
import multiprocessing

_start_method_set = False


def apply_workaround():
global _start_method_set
# Set start method for multiprocessing to fork (3.4+)
set_start_method = getattr(multiprocessing, 'set_start_method', None)
if not _start_method_set and set_start_method:
set_start_method('fork')
_start_method_set = True

# Implements:
# https://github.com/python/cpython/commit/e8a57b98ec8f2b161d4ad68ecc1433c9e3caad57
#
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/test_actor_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from leapp.repository.scan import scan_repo


logging.basicConfig(format='%(asctime)-15s %(clientip)s %(user)-8s %(message)s')
logging.basicConfig(format='%(asctime)-15s %(message)s')


class _TestableMessaging(BaseMessaging):
Expand Down

0 comments on commit d3d81b1

Please sign in to comment.