Skip to content

Commit 0281e5c

Browse files
committed
Corrected usages of some class variables.
1 parent d9c2c34 commit 0281e5c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cmd2/cmd2.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class Cmd:
347347

348348
def __init__(
349349
self,
350-
completekey: str = DEFAULT_COMPLETEKEY,
350+
completekey: str | None = None,
351351
stdin: TextIO | None = None,
352352
stdout: TextIO | None = None,
353353
*,
@@ -429,9 +429,12 @@ def __init__(
429429
self._initialize_plugin_system()
430430

431431
# Configure a few defaults
432-
self.prompt: str = Cmd.DEFAULT_PROMPT
432+
self.prompt: str = self.DEFAULT_PROMPT
433433
self.intro = intro
434434

435+
if completekey is None:
436+
completekey = self.DEFAULT_COMPLETEKEY
437+
435438
# What to use for standard input
436439
if stdin is not None:
437440
self.stdin = stdin
@@ -459,7 +462,7 @@ def __init__(
459462
self.always_show_hint = False
460463
self.debug = False
461464
self.echo = False
462-
self.editor = Cmd.DEFAULT_EDITOR
465+
self.editor = self.DEFAULT_EDITOR
463466
self.feedback_to_output = False # Do not include nonessentials in >, | output by default (things like timing)
464467
self.quiet = False # Do not suppress nonessential output
465468
self.scripts_add_to_history = True # Scripts and pyscripts add commands to history

0 commit comments

Comments
 (0)