Skip to content

Conversation

@tyzhnenko
Copy link
Contributor

Checking timediff sign by dash in first character of hour variable instead of comparison with zero.

MySQLdb/times.py Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel following is better.

h, m, s, ms = abs(int(h)), int(m), int(s), int(ms)
td = timedelta(hours=h, minutes=m, seconds=s microseconds=ms)

Because to know "sign of h is meaningless", I should look abs(h) and h is never used after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Fix it.

@methane
Copy link
Collaborator

methane commented Jun 6, 2014

For your and my information, I've merged this to mysqlclient-python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants