diff --git a/modules/gui/src/python_shell/python_shell_widget.cc b/modules/gui/src/python_shell/python_shell_widget.cc
index f646924105ee0193f78646e9c9ec9bf24d4464b0..dc1190018c8f04e65cb3c55041d4a2b11313b3ab 100644
--- a/modules/gui/src/python_shell/python_shell_widget.cc
+++ b/modules/gui/src/python_shell/python_shell_widget.cc
@@ -737,6 +737,14 @@ QTextBlock PythonShellWidget::GetEditStartBlock()
 
 void PythonShellWidget::keyPressEvent(QKeyEvent* event)
 {
+  // BZDNG-173
+  if (event->key()==Qt::Key_Left) {
+    if (this->textCursor().position()==GetEditStartBlock().position() ||
+        this->textCursor().anchor()==GetEditStartBlock().position()) {
+      event->accept();
+      return;
+    }
+  }
   if (this->handle_custom_commands_(event)){
     return;
   }
diff --git a/modules/gui/src/python_shell/transition_guard.cc b/modules/gui/src/python_shell/transition_guard.cc
index c32898964cf3a17c7375b5824b9fa0343cd538e1..940d5bba15a96f7605ffa90348cf6f64933f9994 100644
--- a/modules/gui/src/python_shell/transition_guard.cc
+++ b/modules/gui/src/python_shell/transition_guard.cc
@@ -37,7 +37,7 @@ EditPositionGuard::EditPositionGuard(PythonShellWidget* shell, int flags1, int f
 
 bool EditPositionGuard::check()
 {
-  return check_flag(flags1_) &&  check_flag(flags2_);
+    return check_flag(flags1_) &&  check_flag(flags2_);
 }
 
 bool EditPositionGuard::check_flag(int flags)