diff options
| author | Stefan Behnel <stefan_ml@behnel.de> | 2013-02-17 11:27:45 +0100 |
|---|---|---|
| committer | Stefan Behnel <stefan_ml@behnel.de> | 2013-02-17 11:27:45 +0100 |
| commit | 328d69f6bfd921af2c2def9aa698ad71008bab94 (patch) | |
| tree | 5bb6840db65700d1f6751eb2206149c0f5a954ec /src/lxml/docloader.pxi | |
| parent | 57ec01e3e54f64060e085986d87303ada409015e (diff) | |
| download | python-lxml-328d69f6bfd921af2c2def9aa698ad71008bab94.tar.gz | |
remove some useless explicit usages of C-API calls from the code base
Diffstat (limited to 'src/lxml/docloader.pxi')
| -rw-r--r-- | src/lxml/docloader.pxi | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lxml/docloader.pxi b/src/lxml/docloader.pxi index f4053c91..850302f0 100644 --- a/src/lxml/docloader.pxi +++ b/src/lxml/docloader.pxi @@ -55,9 +55,9 @@ cdef class Resolver: argument. """ cdef _InputDocument doc_ref - if python.PyUnicode_Check(string): - string = python.PyUnicode_AsUTF8String(string) - elif not python.PyBytes_Check(string): + if isinstance(string, unicode): + string = (<unicode>string).encode('utf8') + elif not isinstance(string, bytes): raise TypeError, "argument must be a byte string or unicode string" doc_ref = _InputDocument() doc_ref._type = PARSER_DATA_STRING |
