Skip to content

Commit

Permalink
python: Replace usages of Python2-only import __builtin__ with a Py…
Browse files Browse the repository at this point in the history
…thon 3 compatible equivalent (#3329)
  • Loading branch information
echoix committed Jan 28, 2024
1 parent 3e874b9 commit 5b2460a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gui/wxpython/core/toolboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,9 @@ def new_translator(string):
sys.displayhook = new_displayhook
sys.__displayhook__ = new_displayhook

import __builtin__
import builtins

__builtin__._ = new_translator
builtins.__dict__["_"] = new_translator


def doc_test():
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,9 +1134,9 @@ def new_translator(string):

sys.displayhook = new_displayhook

import __builtin__
import builtins

__builtin__._ = new_translator
builtins.__dict__["_"] = new_translator


def doc_test():
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/tools/build_modules_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def new_translator(string):
sys.displayhook = new_displayhook
sys.__displayhook__ = new_displayhook

import __builtin__
import builtins

__builtin__._ = new_translator
builtins.__dict__["_"] = new_translator


def parse_modules(fd):
Expand Down
4 changes: 2 additions & 2 deletions python/grass/gunittest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def new_translator(string):

sys.displayhook = new_displayhook

import builtins as __builtin__
import builtins

__builtin__._ = new_translator
builtins.__dict__["_"] = new_translator


_MAX_LENGTH = 80
Expand Down

0 comments on commit 5b2460a

Please sign in to comment.