From d926bc40260549b997a6a5a1e82d9e7999dbb65e Mon Sep 17 00:00:00 2001 From: Akira Baruah Date: Sat, 2 Dec 2017 02:00:49 -0800 Subject: 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. --- third_party/py/gflags/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'third_party/py') 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 * -- cgit v1.2.3