cubicweb/server/utils.py
changeset 12567 26744ad37953
parent 12508 a8c1ea390400
child 12574 6ccf8fda063f
--- a/cubicweb/server/utils.py	Fri Apr 05 17:21:14 2019 +0200
+++ b/cubicweb/server/utils.py	Fri Apr 05 17:58:19 2019 +0200
@@ -16,19 +16,12 @@
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """Some utilities for the CubicWeb server."""
-from __future__ import print_function
-
 
 from functools import wraps
-import sched
-import sys
 import logging
 from threading import Thread
 from getpass import getpass
 
-from six import PY2, text_type
-from six.moves import input
-
 from passlib.utils import handlers as uh, to_hash_str
 from passlib.context import CryptContext
 
@@ -92,8 +85,6 @@
             print(msg)
         while not user:
             user = input('login: ')
-        if PY2:
-            user = text_type(user, sys.stdin.encoding)
     passwd = getpass('%s: ' % passwdmsg)
     if confirm:
         while True:
@@ -106,22 +97,6 @@
     return user, passwd
 
 
-if PY2:
-    import time  # noqa
-
-    class scheduler(sched.scheduler):
-        """Python2 version of sched.scheduler that matches Python3 API."""
-
-        def __init__(self, **kwargs):
-            kwargs.setdefault('timefunc', time.time)
-            kwargs.setdefault('delayfunc', time.sleep)
-            # sched.scheduler is an old-style class.
-            sched.scheduler.__init__(self, **kwargs)
-
-else:
-    scheduler = sched.scheduler
-
-
 def schedule_periodic_task(scheduler, interval, func, *args):
     """Enter a task with `func(*args)` as a periodic event in `scheduler`
     executing at `interval` seconds. Once executed, the task would re-schedule