In L421 of config.py the prod_branch variable is set based on whether or not the environment is called master.
Since Platform.sh now allows for renaming the default / production branch, this no longer produces an accurate value because it can be called anything (defaulting to main).
A more accurate way of determining whether or not the current branch is a production branch is to query the PLATFORM_ENVIRONMENT_TYPE environmental variable, which will return the correct environment type regardless of its name.