yserial icon indicating copy to clipboard operation
yserial copied to clipboard

cur will be undefined if ysql.connect fails

Open glennra opened this issue 7 years ago • 3 comments

https://github.com/rsvp/yserial/blob/e7f752754fae9ef0059fc7d988392a96cb95f12a/y_serial_dev.py#L570

glennra avatar Feb 15 '18 02:02 glennra

not sure of the best way to fix this but maybe:

if 'cur' in locals():
    cur.close()

glennra avatar Feb 15 '18 21:02 glennra

@glennra hi Glen, the fallbacks will be corrected when yserial gets rewritten for python3 using better flow constructs.

Thanks for your attention in the matter.

Other than the current issue, are there any critical fails when you run the code against python2 ?

rsvp avatar Feb 15 '18 21:02 rsvp

Yes, in 0.60 there was an issue with error reporting that I fixed in my copy. I will have to look it up. I'll create a new issue if the problem still exists.

glennra avatar Feb 15 '18 21:02 glennra