mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Some Python 2 removals
This commit is contained in:
@@ -18,11 +18,7 @@ Options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import time
|
import time
|
||||||
try:
|
import profile
|
||||||
# For Python 2
|
|
||||||
import cProfile as profile
|
|
||||||
except ImportError:
|
|
||||||
import profile
|
|
||||||
import pstats
|
import pstats
|
||||||
|
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
|
|||||||
1
setup.py
1
setup.py
@@ -37,7 +37,6 @@ setup(name='jedi',
|
|||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
extras_require={
|
extras_require={
|
||||||
'testing': [
|
'testing': [
|
||||||
# Pytest 5 doesn't support Python 2 anymore.
|
|
||||||
'pytest<6.0.0',
|
'pytest<6.0.0',
|
||||||
# docopt for sith doctests
|
# docopt for sith doctests
|
||||||
'docopt',
|
'docopt',
|
||||||
|
|||||||
@@ -291,14 +291,6 @@ except ImportError as i_a:
|
|||||||
i_a
|
i_a
|
||||||
#? ImportError()
|
#? ImportError()
|
||||||
i_a
|
i_a
|
||||||
try:
|
|
||||||
import math
|
|
||||||
except ImportError, i_b:
|
|
||||||
# TODO check this only in Python2
|
|
||||||
##? ['i_b']
|
|
||||||
i_b
|
|
||||||
##? ImportError()
|
|
||||||
i_b
|
|
||||||
|
|
||||||
|
|
||||||
class MyException(Exception):
|
class MyException(Exception):
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def test_folder_io_walk():
|
|||||||
root, folder_ios, file_ios = next(iterator)
|
root, folder_ios, file_ios = next(iterator)
|
||||||
assert folder_ios
|
assert folder_ios
|
||||||
assert root.path == join(root_dir, 'ns2')
|
assert root.path == join(root_dir, 'ns2')
|
||||||
folder_ios[:] = [] # Not folder_ios.clear() because Python 2
|
folder_ios.clear()
|
||||||
assert next(iterator, None) is None
|
assert next(iterator, None) is None
|
||||||
|
|
||||||
|
|
||||||
@@ -23,5 +23,5 @@ def test_folder_io_walk2():
|
|||||||
root_dir = get_example_dir('namespace_package')
|
root_dir = get_example_dir('namespace_package')
|
||||||
iterator = FolderIO(root_dir).walk()
|
iterator = FolderIO(root_dir).walk()
|
||||||
root, folder_ios, file_ios = next(iterator)
|
root, folder_ios, file_ios = next(iterator)
|
||||||
folder_ios[:] = [] # Not folder_ios.clear() because Python 2
|
folder_ios.clear()
|
||||||
assert next(iterator, None) is None
|
assert next(iterator, None) is None
|
||||||
|
|||||||
Reference in New Issue
Block a user