. . .
#ifndef USING_PYTHON2
from logginginterface import * # python2 code
#else /* USING_PYTHON2 */
from .logginginterface import * # python3 code
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
import urlliburllib # python2 code
#else /* USING_PYTHON2 */
import urllib.request, urllib.parse, urllib.errorerror # python3 code
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
return urllib.quote(str(s), '') # python2 code
#else /* USING_PYTHON2 */
return urllib.parse.quote(str(s), '') # python3 code
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
os.umask(077) # python2 code
#else /* USING_PYTHON2 */
os.umask(0o77) # python3 code
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
if openstack.has_key('custom_configuration'): # python2 code
#else /* USING_PYTHON2 */
if 'custom_configuration' in openstack:openstack: # python3 code
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
print >>fp, binascii.hexlify(b).decode('utf-8') # python2 code
#else /* USING_PYTHON2 */
print(binascii.hexlify(b).decode('utf-8'), file=fp) # python3 code
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
debug("ctx node has the following Properties: {}".format(i.properties.keys()))
#else /* USING_PYTHON2 */
debug("ctx node has the following Properties: {}".format(list(i.properties.keys())))
#endif /* USING_PYTHON2 */
. . .
#ifndef USING_PYTHON2
for k, nv in want.items(): # python2 code
#else /* USING_PYTHON2 */
for k, nv in list(want.items()): # python3 code
#endif /* USING_PYTHON2 */
. . .
|