Skip to content

Commit

Permalink
Remove Python 2 stuff:
Browse files Browse the repository at this point in the history
file header -*- coding: utf-8 -*-
strings with u-prefix e.g. u'string'
  • Loading branch information
cvzi committed Jun 6, 2023
1 parent e24c34b commit 22cb8d8
Show file tree
Hide file tree
Showing 8 changed files with 28,218 additions and 28,233 deletions.
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ expression yourself like this:
# Sort emoji by length to make sure multi-character emojis are
# matched first
emojis = sorted(emoji.EMOJI_DATA, key=len, reverse=True)
pattern = u'(' + u'|'.join(re.escape(u) for u in emojis) + u')'
pattern = '(' + '|'.join(re.escape(u) for u in emojis) + ')'
return re.compile(pattern)
exp = get_emoji_regexp()
print(exp.sub(repl='[emoji]', string=u'A πŸŒοΈβ€β™€οΈ is eating a πŸ₯'))
print(exp.sub(repl='[emoji]', string='A πŸŒοΈβ€β™€οΈ is eating a πŸ₯'))
..
Output:
Expand Down
4 changes: 2 additions & 2 deletions emoji/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def demojize(
>>> import emoji
>>> print(emoji.emojize("Python is fun :thumbs_up:"))
Python is fun πŸ‘
>>> print(emoji.demojize(u"Python is fun πŸ‘"))
>>> print(emoji.demojize("Python is fun πŸ‘"))
Python is fun :thumbs_up:
>>> print(emoji.demojize(u"Unicode is tricky 😯", delimiters=("__", "__")))
>>> print(emoji.demojize(icode is tricky 😯", delimiters=("__", "__")))
Unicode is tricky __hushed_face__
:param string: String contains Unicode characters. MUST BE UNICODE.
Expand Down
2 changes: 0 additions & 2 deletions emoji/unicode_codes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from emoji.unicode_codes.data_dict import *

__all__ = [
Expand Down
Loading

0 comments on commit 22cb8d8

Please sign in to comment.