summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 2ea68b3..7fdeb08 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -674,9 +674,11 @@ class NavigableString(unicode, PageElement):
how to handle non-ASCII characters.
"""
if isinstance(value, unicode):
- return unicode.__new__(cls, value)
- u = unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
+ u = unicode.__new__(cls, value)
+ else:
+ u = unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
u.setup()
+ return u
def __copy__(self):
return self