aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/py
diff options
context:
space:
mode:
authorGravatar Akira Baruah <akira.baruah@gmail.com>2017-12-02 02:00:49 -0800
committerGravatar Ulf Adams <ulfjack@google.com>2017-12-04 10:02:01 +0100
commitd926bc40260549b997a6a5a1e82d9e7999dbb65e (patch)
treed8a8866cad9aada802ed09df6e706fa119f67b57 /third_party/py
parentd3fed125d00f6f61bfbfe05f4566656cdac1ea6e (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__.py5
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 *