Skip to content

Commit

Permalink
UPBGE: Rename async parameter from LibLoad as is a reserved word (#827)
Browse files Browse the repository at this point in the history
Rename async parameter from LibLoad as is a reserved word in Python 3.7

A note will be included in Release notes as this breaks compatibility with old scripts.
  • Loading branch information
lordloki authored Sep 9, 2018
1 parent 04b7275 commit 1959ed2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doc/python_api/rst/bge.logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ General functions

Restarts the current game by reloading the .blend file (the last saved version, not what is currently running).

.. function:: LibLoad(blend, type, data, load_actions=False, verbose=False, load_scripts=True, async=False, scene=None)
.. function:: LibLoad(blend, type, data, load_actions=False, verbose=False, load_scripts=True, asynchronous=False, scene=None)

Converts the all of the datablocks of the given type from the given blend.

Expand All @@ -201,8 +201,8 @@ General functions
:type verbose: bool
:arg load_scripts: Whether or not to load text datablocks as well (can be disabled for some extra security)
:type load_scripts: bool
:arg async: Whether or not to do the loading asynchronously (in another thread). Only the "Scene" type is currently supported for this feature.
:type async: bool
:arg asynchronous: Whether or not to do the loading asynchronously (in another thread). Only the "Scene" type is currently supported for this feature.
:type asynchronous: bool
:arg scene: Scene to merge loaded data to, if `None` use the current scene.
:type scene: :class:`bge.types.KX_Scene` or string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ base class --- :class:`EXP_PyObjectPlus`
def finished_cb(status):
print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))
bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb
bge.logic.LibLoad('myblend.blend', 'Scene', asynchronous=True).onFinish = finished_cb
.. attribute:: onFinish

Expand Down
8 changes: 4 additions & 4 deletions source/gameengine/Ketsji/KX_PythonInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,11 @@ static PyObject *gLibLoad(PyObject *, PyObject *args, PyObject *kwds)
KX_LibLoadStatus *status = nullptr;

short options = 0;
int load_actions = 0, verbose = 0, load_scripts = 1, async = 0;
int load_actions = 0, verbose = 0, load_scripts = 1, asynchronous = 0;

if (!EXP_ParseTupleArgsAndKeywords(args, kwds, "ss|y*iiIiO:LibLoad",
{"path", "group", "buffer", "load_actions", "verbose", "load_scripts", "async", "scene", 0},
&path, &group, &py_buffer, &load_actions, &verbose, &load_scripts, &async, &pyscene)) {
{"path", "group", "buffer", "load_actions", "verbose", "load_scripts", "asynchronous", "scene", 0},
&path, &group, &py_buffer, &load_actions, &verbose, &load_scripts, &asynchronous, &pyscene)) {
return nullptr;
}

Expand All @@ -667,7 +667,7 @@ static PyObject *gLibLoad(PyObject *, PyObject *args, PyObject *kwds)
if (load_scripts != 0) {
options |= BL_Converter::LIB_LOAD_LOAD_SCRIPTS;
}
if (async != 0) {
if (asynchronous != 0) {
options |= BL_Converter::LIB_LOAD_ASYNC;
}

Expand Down

0 comments on commit 1959ed2

Please sign in to comment.