Completed
Push — master ( ccac5d...08d670 )
by Andrew
01:22
created

get_unicode()   A

Complexity

Conditions 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
import sys
2
3
try:  # py2
4
	from urllib import urlopen
5
except ImportError:  # py3
6
	from urllib.request import urlopen
7
8
9
try:  # py2
10
	from urlparse import urlparse
11
except ImportError:  # py3
12
	from urllib.parse import urlparse
13
14
try:
15
	from urllib import quote
16
except ImportError:  # py3
17
	from urllib.parse import quote
18
19
def get_unicode(ch):
20
	if sys.version > '3':
21
		return chr(ch)
22
	else:
23
		return unichr(ch)
24
25
str_type = str if sys.version > '3' else basestring