diff options
author | Akira Baruah <akira.baruah@gmail.com> | 2017-12-02 02:00:49 -0800 |
---|---|---|
committer | Ulf Adams <ulfjack@google.com> | 2017-12-04 10:02:01 +0100 |
commit | d926bc40260549b997a6a5a1e82d9e7999dbb65e (patch) | |
tree | d8a8866cad9aada802ed09df6e706fa119f67b57 /third_party/py | |
parent | d3fed125d00f6f61bfbfe05f4566656cdac1ea6e (diff) |
Spoof gflags pseudo-package __name__ for backwards compatibility.
The core gflags package is `third_party.py.gflags.gflags`, but many downstream
projects and tools use the pseudo-package `third_party.py.gflags`. gflags raises
DuplicateFlagError when defining default flags from packages with different
names, so this fix adjusts the pseudo-package's __name__ attribute to match that
of the core package.
Diffstat (limited to 'third_party/py')
-rw-r--r-- | third_party/py/gflags/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/py/gflags/__init__.py b/third_party/py/gflags/__init__.py index 77e4285448..fee354a360 100644 --- a/third_party/py/gflags/__init__.py +++ b/third_party/py/gflags/__init__.py @@ -1 +1,6 @@ +# gflags raises DuplicateFlagError when defining default flags from packages +# with different names, so this pseudo-package must mimic the core gflags +# package name. +__name__ += ".gflags" # i.e. "third_party.py.gflags.gflags" + from gflags import * |