Skip to content

Commit ce98d84

Browse files
authored
Fix: Ensure deterministic locale selection in multi-locale mode (#2287)
increase minor version
1 parent fb98b61 commit ce98d84

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

faker/proxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ def _select_factory(self, method_name: str) -> Factory:
185185
return factory
186186

187187
def _select_factory_distribution(self, factories, weights):
188-
return choices_distribution(factories, weights, random, length=1)[0]
188+
return choices_distribution(factories, weights, self.factories[0].random, length=1)[0]
189189

190190
def _select_factory_choice(self, factories):
191-
return random.choice(factories)
191+
return self._factories[0].random.choice(factories)
192192

193193
def _map_provider_method(self, method_name: str) -> tuple[list[Factory], list[float] | None]:
194194
"""

0 commit comments

Comments
 (0)