diff options
author | Marc Hoersken <info@marc-hoersken.de> | 2020-03-12 09:26:56 +0100 |
---|---|---|
committer | Marc Hoersken <info@marc-hoersken.de> | 2020-03-13 02:49:07 +0100 |
commit | a7e24c736267d0cbf9ab2eedf2027b7d26e317bb (patch) | |
tree | 9e9d292440f90cb319204c54e65e709921d79c05 /tests/python_dependencies/impacket/smb.py | |
parent | ba0e6fbd30a2f5130b34525f4d7920b8b98ff0b0 (diff) |
impacket: some more Python 3 code compatibility updates
This makes smbserver load on Python 3, but still not work completely.
Diffstat (limited to 'tests/python_dependencies/impacket/smb.py')
-rw-r--r-- | tests/python_dependencies/impacket/smb.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/python_dependencies/impacket/smb.py b/tests/python_dependencies/impacket/smb.py index c4ea6fc68..fa3a3d4fe 100644 --- a/tests/python_dependencies/impacket/smb.py +++ b/tests/python_dependencies/impacket/smb.py @@ -57,10 +57,14 @@ import hashlib unicode_support = 0 unicode_convert = 1 -try: - from cStringIO import StringIO -except ImportError: - from StringIO import StringIO +import sys +if sys.version_info.major >= 3: + from io import StringIO +else: + try: + from cStringIO import StringIO + except ImportError: + from StringIO import StringIO # Dialect for SMB1 SMB_DIALECT = 'NT LM 0.12' |