Skip to content

Commit

Permalink
Improve Py 2/3 compatibility to fix mavlink#893
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishwillee authored and LorenzMeier committed Apr 25, 2018
1 parent 28bc02c commit b50c7c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mavgenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
"""
import os
import re
import re
import sys

# Python 2.x and 3.x compatibility
try:
if sys.version_info[0] == 3:
from tkinter import *
import tkinter.filedialog
import tkinter.messagebox
except ImportError as ex:
else:
# Must be using Python 2.x, import and rename
from Tkinter import *
import tkFileDialog
Expand All @@ -38,6 +39,7 @@
del tkFileDialog
tkinter.messagebox = tkMessageBox
del tkMessageBox


from pymavlink.generator import mavgen
from pymavlink.generator import mavparse
Expand Down

0 comments on commit b50c7c0

Please sign in to comment.