Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add stub for pyicu
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier committed Dec 6, 2022
1 parent 7806e21 commit d632735
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions stubs/icu.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2022 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Stub for PyICU.

class Locale:
@staticmethod
def getDefault() -> Locale: ...

class BreakIterator:
@staticmethod
def createWordInstance(locale: Locale) -> BreakIterator: ...
def setText(self, text: str) -> None: ...
def nextBoundary(self) -> int: ...
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/user_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

try:
# Figure out if ICU support is available for searching users.
import icu # type: ignore[import]
import icu

USE_ICU = True
except ModuleNotFoundError:
Expand Down

0 comments on commit d632735

Please sign in to comment.