Commit 4c20be50 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

fixup! py2/py3: string.letters is locale-dependent and removed in Python 3.

parent f16ee152
...@@ -30,7 +30,7 @@ import unittest ...@@ -30,7 +30,7 @@ import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from erp5.component.tool.SessionTool import SESSION_CACHE_FACTORY from erp5.component.tool.SessionTool import SESSION_CACHE_FACTORY
from string import letters as LETTERS from string import ascii_letters as LETTERS
from random import choice from random import choice
import time import time
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
""" """
from random import choice from random import choice
from string import letters, digits from string import ascii_letters, digits
character_set = '' character_set = ''
if include_letters: if include_letters:
character_set = '%s%s' %(character_set, letters) character_set = '%s%s' %(character_set, ascii_letters)
if include_digits: if include_digits:
character_set = '%s%s' %(character_set, digits) character_set = '%s%s' %(character_set, digits)
return ''.join([choice(character_set) for _ in range(int(string_length))]) return ''.join([choice(character_set) for _ in range(int(string_length))])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment