Skip to content

Support None for set_option(OPT_NETWORK_TIMEOUT) #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2017

Conversation

tiran
Copy link
Member

@tiran tiran commented Dec 5, 2017

The setter for network timeout and timeout options now support None as
value. None is mapped to infinity.

Closes: #95
Signed-off-by: Christian Heimes cheimes@redhat.com

@codecov
Copy link

codecov bot commented Dec 5, 2017

Codecov Report

Merging #104 into master will increase coverage by 0.11%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   67.96%   68.07%   +0.11%     
==========================================
  Files          48       48              
  Lines        4676     4680       +4     
  Branches      785      786       +1     
==========================================
+ Hits         3178     3186       +8     
+ Misses       1146     1144       -2     
+ Partials      352      350       -2
Impacted Files Coverage Δ
Modules/options.c 80.48% <100%> (+1%) ⬆️
Lib/ldap/ldapobject.py 66.73% <0%> (+0.42%) ⬆️
Lib/slapdtest/_slapdtest.py 81.36% <0%> (+0.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 084ffe0...12f193e. Read the comment docs.

The setter for network timeout and timeout options now support None as
value. None is mapped to infinity.

Closes: python-ldap#95
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@encukou
Copy link
Member

encukou commented Dec 5, 2017

Looks great at first glance!
I'll most likely get to reviewing/merging on Thursday.

@encukou
Copy link
Member

encukou commented Dec 7, 2017

Rewriting the conversion error message should happen only on TypeError. I changed that, (hopefully) made the control flow a bit more straightforward, and removed the nonstandard PyNone_Check.

} else {
/* 'd' handles int/long */
if (!PyArg_Parse(value, "d:set_option", &doubleval)) {
if (PyErr_ExceptionMatches(PyExc_TypeError)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! I haven't considered overflows.

@encukou encukou merged commit 4d3cd7d into python-ldap:master Dec 11, 2017
@tiran tiran deleted the timeout_none branch December 11, 2017 11:25
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy