I just tried the link by the previous answerer:
https://blenderartists.org/t/2-80-cheat-sheet-for-updating-add-ons/1148974.
It's said in it that:
So I just ran into this problem updating Level Builder, and the answer didn’t come up in a Google search so I am updating this necro thread.
bpy.data.scenes[“Scene”].render.alpha_mode : [“SKY”, “TRANSPARENT”] is now bpy.data.scenes[“Scene”].render.film_transparent : [0, 1]
Here’s hoping Google finds this answer for the next coder.
So I modified my code like this and it worked fine:
if g_background_image_path == 'TRANSPARENT':
# bpy.context.scene.render.alpha_mode = g_background_image_path # 2.79
bpy.context.scene.render.image_settings.color_mode = 'RGBA' # blender 2.8
bpy.context.scene.render.film_transparent = 1 # 0 for "SKY"; 1 for "TRANSPARENT