Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e80fbc1

Browse files
committed
optional pickleshare
1 parent d688ff0 commit e80fbc1

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

IPython/core/interactiveshell.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,28 @@
3737
from typing import Optional, Sequence, Tuple
3838
from warnings import warn
3939

40-
from pickleshare import PickleShareDB
40+
try:
41+
from pickleshare import PickleShareDB
42+
except ModuleNotFoundError:
43+
44+
class PickleShareDB:
45+
def __init__(self, path):
46+
pass
47+
48+
def get(self, key, default):
49+
warn(
50+
f"using {key} requires you to install the `pickleshare` library.",
51+
stacklevel=2,
52+
)
53+
return default
54+
55+
def __setitem__(self, key, value):
56+
warn(
57+
f"using {key} requires you to install the `pickleshare` library.",
58+
stacklevel=2,
59+
)
60+
61+
4162
from tempfile import TemporaryDirectory
4263
from traitlets import (
4364
Any,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ install_requires =
3737
jedi>=0.16
3838
matplotlib-inline
3939
pexpect>4.3; sys_platform != "win32"
40-
pickleshare
4140
prompt_toolkit>=3.0.30,<3.1.0,!=3.0.37
4241
pygments>=2.4.0
4342
stack_data
@@ -77,6 +76,7 @@ test =
7776
pytest<7.1
7877
pytest-asyncio
7978
testpath
79+
pickleshare
8080
test_extra =
8181
%(test)s
8282
curio

0 commit comments

Comments
 (0)