Sometimes it is needed to use only one or another library to access the network. E.g., sometimes socket is ok, but pycurl is not, or in the case if there will be more libraries to patch (maybe psycopg2 or some others), then it would be nice to have some granular control over what to disable and what is not.
Implementation notes:
Add a global container of available transports, e.g. TRANSPORTS = ("socket", "pycurl")
Then add a new transports argument to network.block with the default value of TRANSPORTS
Add conditions inside network.block to patch only transports defined in the new arguments
Sometimes it is needed to use only one or another library to access the network. E.g., sometimes
socket
is ok, butpycurl
is not, or in the case if there will be more libraries to patch (maybepsycopg2
or some others), then it would be nice to have some granular control over what to disable and what is not.Implementation notes:
TRANSPORTS = ("socket", "pycurl")
transports
argument tonetwork.block
with the default value ofTRANSPORTS
network.block
to patch only transports defined in the new arguments