Bug 1428362 - Add Python 3 support to mozterm; r=ahal

MozReview-Commit-ID: CBl7XKXPABv
This commit is contained in:
Dave Hunt
2018-05-30 13:51:30 +01:00
parent 8661e0788e
commit cf46b26a3f
2 changed files with 9 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ from __future__ import absolute_import, unicode_literals
import os
import sys
import six
class NullTerminal(object):
"""Replacement for `blessings.Terminal()` that does no formatting."""
@@ -21,10 +23,10 @@ class NullTerminal(object):
except Exception:
self.is_a_tty = False
class NullCallableString(unicode):
class NullCallableString(six.text_type):
"""A dummy callable Unicode stolen from blessings"""
def __new__(cls):
new = unicode.__new__(cls, '')
new = six.text_type.__new__(cls, '')
return new
def __call__(self, *args):

View File

@@ -7,7 +7,7 @@ from __future__ import absolute_import
from setuptools import setup
VERSION = '0.1.0'
DEPS = []
DEPS = ['six >= 1.10.0']
setup(
name='mozterm',
@@ -23,6 +23,10 @@ setup(
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
install_requires=DEPS,
)