Fix a couple of import statements.
This commit is contained in:
parent
3951e91c08
commit
d5b900cf13
|
@ -548,12 +548,12 @@ Programming Recommendations
|
||||||
In Python 2.2, the types module has the StringTypes type defined
|
In Python 2.2, the types module has the StringTypes type defined
|
||||||
for that purpose, e.g.:
|
for that purpose, e.g.:
|
||||||
|
|
||||||
from string import StringTypes
|
from types import StringTypes
|
||||||
if isinstance(obj, StringTypes):
|
if isinstance(obj, StringTypes):
|
||||||
|
|
||||||
In Python 2.0 and 2.1, you should do:
|
In Python 2.0 and 2.1, you should do:
|
||||||
|
|
||||||
from string import StringType, UnicodeType
|
from types import StringType, UnicodeType
|
||||||
if isinstance(obj, StringType) or \
|
if isinstance(obj, StringType) or \
|
||||||
isinstance(obj, UnicodeType) :
|
isinstance(obj, UnicodeType) :
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue