Skip to content

Commit

Permalink
Removed six requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 authored and frozencemetery committed Aug 18, 2021
1 parent b29a827 commit e9b5bfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 5 additions & 6 deletions k5test/realm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# Changes from original:
# - modified to work with Python's unittest
# - added Heimdal support
# - removed some Python 2 specific code
import abc
import copy
import os
Expand All @@ -38,8 +39,6 @@
import tempfile
import logging

import six

from k5test import _utils


Expand Down Expand Up @@ -267,7 +266,7 @@ def _write_cfg_section(self, conf_file, contents, indent_level):
for item in value:
item = self._subst_cfg_value(item)
conf_file.write('%s%s = %s\n' % (indent, name, item))
elif isinstance(value, six.string_types):
elif isinstance(value, str):
# A string value yields a straightforward variable setting.
value = self._subst_cfg_value(value)
conf_file.write('%s%s = %s\n' % (indent, name, value))
Expand Down Expand Up @@ -314,8 +313,8 @@ def _make_env(self, krb5_conf_path, kdc_conf_path):
env['KRB5_KTNAME'] = self.keytab
env['KRB5_CLIENT_KTNAME'] = self.client_keytab
env['KRB5RCACHEDIR'] = self.tmpdir
env['KPROPD_PORT'] = six.text_type(self.kprop_port())
env['KPROP_PORT'] = six.text_type(self.kprop_port())
env['KPROPD_PORT'] = str(self.kprop_port())
env['KPROP_PORT'] = str(self.kprop_port())
return env

def run(self, args, env=None, input=None, expected_code=0):
Expand Down Expand Up @@ -407,7 +406,7 @@ def stop(self):

def password(self, name):
"""Get a weakly random password from name, consistent across calls."""
return name + six.text_type(os.path.basename(self.tmpdir))
return name + str(os.path.basename(self.tmpdir))

def special_env(self, name, has_kdc_conf, krb5_conf=None, kdc_conf=None):
krb5_conf_path = os.path.join(self.tmpdir, f'krb5.conf.{name}')
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Security',
],
keywords=['gssapi', 'security'],
install_requires=['six'],
install_requires=[],
extras_require={
'extension_test': ['gssapi']
}
Expand Down

0 comments on commit e9b5bfe

Please sign in to comment.