If it is working in your local environment then the problem lies in porting to Bluemix. If it was working before you made your changes then its something that you have added. Assuming of course that you have made no changes to your Procfile, and the way the program launches.
This points at differences in the python runtime between your local environment and Bluemix. What will be happening is that a code structure (something like the way you perform an iteration) is supported in the python version you are running locally, but not supported by the python version you are using on bluemix.
If you don't have a runtime.txt file then create one. Set its contents it to the version of python that you have on your local environment (eg. python-3.4.3)
Check on the python runtime on Bluemix, to see which versions of python are supported. If your version isn't then you will need to explicitly set the buildpack in your manifest.yml file. eg. buildpack: https://github.com/cloudfoundry/python-buildpack#v1.5.1
I normally do this anyway to insulate my apps from changes to the default Bluemix runtimes.
If none of this helps then you have created a coding error in code that is only executed on Bluemix.