Skip to content

Commit bd96703

Browse files
authored
Merge pull request #13647 from meeseeksmachine/auto-backport-of-pr-13639-on-v5.0.x
Backport PR #13639 on branch v5.0.x (Fix Python 3.11 issue for pprint_include/exclude_names)
2 parents 4db4639 + 2f41334 commit bd96703

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎astropy/table/table.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2685,7 +2685,7 @@ def remove_columns(self, names):
26852685
This gives the same as using remove_column.
26862686
'''
26872687
for name in self._set_of_names_in_colnames(names):
2688-
self.columns.pop(name)
2688+
del self.columns[name]
26892689

26902690
def _convert_string_dtype(self, in_kind, out_kind, encode_decode_func):
26912691
"""
@@ -2786,7 +2786,7 @@ def keep_columns(self, names):
27862786
names = self._set_of_names_in_colnames(names)
27872787
for colname in self.colnames:
27882788
if colname not in names:
2789-
self.columns.pop(colname)
2789+
del self.columns[colname]
27902790

27912791
def rename_column(self, name, new_name):
27922792
'''
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix a Python 3.11 compatibility issue. Ensure that when removing a table column
2+
that the ``pprint_include_names`` or ``pprint_exclude_names`` attributes get
3+
updated correctly.

0 commit comments

Comments
 (0)