scripts/python3/bot/lib/python3.11/site-packages/wordpress_xmlrpc/compat.py

29 lines
597 B
Python
Raw Normal View History

2024-08-29 12:07:22 +03:00
try:
import xmlrpclib as xmlrpc_client # py2.x
except ImportError:
from xmlrpc import client as xmlrpc_client # py3.x
try:
import httplib as http_client # py2.x
except ImportError:
from http import client as http_client #py3.x
import types
try:
dict_type = types.DictType # py2.x
except AttributeError:
dict_type = dict # py3.x
try:
from ConfigParser import ConfigParser # py2.x
except ImportError:
from configparser import ConfigParser # py3.x
try:
unicode('test')
except NameError:
def unicode(s):
return s