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

Skip to content

Commit 559d905

Browse files
committed
Vendor the pickleshare library into the IPython/external directory
* Add `pickleshare.py` to `IPython/external` * Remove `pickleshare` from test dependencies in `pyproject.toml` * Removing warnings about `pickleshare` library in `IPython/core/interactiveshell.py` (manually due to this file being too large to be processed by Copilot Workspace. Consider breaking the file into smaller pieces.)
1 parent b9e8e12 commit 559d905

3 files changed

Lines changed: 355 additions & 11 deletions

File tree

IPython/core/magics/osm.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ class OSMagics(Magics):
3838
help="Force %cd magic to be quiet even if -q is not passed."
3939
).tag(config=True)
4040

41-
suppress_pickleshare_warning = Bool(False,
42-
help="Suppress the warning about pickleshare dependency when changing directory."
43-
).tag(config=True)
44-
4541
def __init__(self, shell=None, **kwargs):
4642

4743
# Now define isexec in a cross platform manner.
@@ -78,7 +74,7 @@ def _isexec_POSIX(self, file):
7874
return False
7975

8076

81-
77+
8278
def _isexec_WIN(self, file):
8379
"""
8480
Test for executable file on non POSIX system
@@ -196,7 +192,7 @@ def unalias(self, parameter_s=''):
196192
return
197193

198194
stored = self.shell.db.get('stored_aliases', {} )
199-
if (aname in stored) and not self.suppress_pickleshare_warning:
195+
if aname in stored:
200196
print("Removing %stored alias",aname)
201197
del stored[aname]
202198
self.shell.db['stored_aliases'] = stored
@@ -418,8 +414,7 @@ def cd(self, parameter_s=''):
418414
dhist = self.shell.user_ns['_dh']
419415
if oldcwd != cwd:
420416
dhist.append(cwd)
421-
if not self.suppress_pickleshare_warning:
422-
self.shell.db['dhist'] = compress_dhist(dhist)[-100:]
417+
self.shell.db['dhist'] = compress_dhist(dhist)[-100:]
423418

424419
else:
425420
os.chdir(self.shell.home_dir)
@@ -430,8 +425,7 @@ def cd(self, parameter_s=''):
430425

431426
if oldcwd != cwd:
432427
dhist.append(cwd)
433-
if not self.suppress_pickleshare_warning:
434-
self.shell.db["dhist"] = compress_dhist(dhist)[-100:]
428+
self.shell.db["dhist"] = compress_dhist(dhist)[-100:]
435429
if "q" not in opts and not self.cd_force_quiet and self.shell.user_ns["_dh"]:
436430
print(self.shell.user_ns["_dh"][-1])
437431

0 commit comments

Comments
 (0)