summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index e1fa7369..4d6ec985 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -867,14 +867,14 @@ class AddSubmenu(object):
raise ValueError("reformat_prompt should be either a format string or None")
self.reformat_prompt = reformat_prompt
+ self.shared_attributes = {} if shared_attributes is None else shared_attributes
if require_predefined_shares:
- for attr in shared_attributes.keys():
+ for attr in self.shared_attributes.keys():
if not hasattr(submenu, attr):
raise AttributeError("The shared attribute '{attr}' is not defined in {cmd}. Either define {attr} "
"in {cmd} or set require_predefined_shares=False."
.format(cmd=submenu.__class__.__name__, attr=attr))
- self.shared_attributes = {} if shared_attributes is None else shared_attributes
self.create_subclass = create_subclass
def __call__(self, cmd_obj):