import sys before we use it on line 9 (GH-828) (GH-833)

(cherry picked from commit 0579e81f30d00da562f021760d5b6a9c35186520)
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index f3ee391..dd6c997 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -1,5 +1,7 @@
 #! /usr/bin/env python3
 
+import sys
+
 try:
     from tkinter import *
 except ImportError:
@@ -25,7 +27,6 @@
 import re
 import socket
 import subprocess
-import sys
 import threading
 import time
 import tokenize