Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 629551729
  • Loading branch information
colaboratory-team committed May 1, 2024
1 parent b844a14 commit 42fa547
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
15 changes: 9 additions & 6 deletions google/colab/_reprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
import numpy as np
import PIL as pil
# pylint: disable=g-import-not-at-top
with warnings.catch_warnings():
# Importing via IPython raises a spurious warning, but avoids a version
# mismatch internally.
warnings.simplefilter('ignore')
from IPython.utils import traitlets

# TODO(b/210783561): Keep both imports as we migrate to IPython 7
try:
with warnings.catch_warnings():
# Importing via IPython raises a spurious warning, but avoids a version
# mismatch internally.
warnings.simplefilter('ignore')
from IPython.utils import traitlets
except ImportError:
import traitlets

_original_string_formatters = {}

Expand Down
19 changes: 11 additions & 8 deletions google/colab/data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@
from IPython import display as _display
import packaging.version as _version


# pylint: disable=g-import-not-at-top
with _warnings.catch_warnings():
# Importing via IPython raises a spurious warning, but avoids a version
# mismatch internally.
_warnings.simplefilter('ignore')
from IPython.utils import traitlets as _traitlets

# pylint: enable=g-import-not-at-top
# TODO(b/210783561): Keep both imports as we migrate to IPython 7
try:
with _warnings.catch_warnings():
# Importing via IPython raises a spurious warning, but avoids a version
# mismatch internally.
_warnings.simplefilter('ignore')
from IPython.utils import traitlets as _traitlets
except ImportError:
# pytype: disable=import-error
import traitlets as _traitlets
# pytype: enable=import-error

__all__ = [
'DataTable',
Expand Down

0 comments on commit 42fa547

Please sign in to comment.