Turning string into object (name)

Chris Angelico rosuav at gmail.com
Sat Jun 27 00:30:54 EDT 2015


On Sat, Jun 27, 2015 at 2:11 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> On Friday, June 26, 2015 at 9:30:38 AM UTC+5:30, Chris Angelico wrote:
>> Incidentally, I would suggest not having the try/except at all, since
>> all it does is print an error and terminate (which is the same result
>> you'd get if that error bubbled all the way to top level). But if you
>> are going to use it, then I strongly recommend using the newer syntax:
>>
>> except errors.ConnectionFailure as e:
>
> I wonder Chris if you know anything about this [yeah a bit of a hijack]:

Well.... yes, that's a complete thread hijack. Whatever.

> There is this git plugin https://github.com/felipec/git-remote-hg
> that allows one to bi-direct talk to hg
>
> I tried to add a little better error checking so that it doesnt barf with a backtrace when connecting to git (instead of hg which is the intent):
>
> My modifs: https://github.com/rusimody/git-remote-hg/commit/51cc665eff174e0d6bbf2e1b61ca332af345e76a
>
> I got some response (from github) to the effect that travis-continuous failed
> or some such.
> Yeah I know about nothing about github pull requests but it just could be
> this -- obsolete except syntax.
>
> Any thoughts? Suggestions?

Standard principle when asking for help with a Python program: Quote
the error text! You say you got a response back - quote it!

Standard debugging technique: If you have an idea, try it! Most code
is deterministic enough that you can simply change to the modern
except syntax and try again. Maybe it won't have any effect, but maybe
it'll tell you exactly what the problem is.

Beyond that, I don't think I can much help you.

ChrisA



More information about the Python-list mailing list