Skip to content

Commit

Permalink
Merge pull request #18 from gnome-terminator/compat-2.7
Browse files Browse the repository at this point in the history
Fix some compat issues for Python 2.7
  • Loading branch information
lazyfrosch authored Apr 17, 2020
2 parents c9e6928 + c7e466d commit 7be1754
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
strategy:
matrix:
python:
#- '2.7'
- '2.7'
- '3.6'
- '3.7'
- '3.8'

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
Expand Down
7 changes: 5 additions & 2 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
gi.require_version('Vte', '2.91') # vte-0.38 (gnome-3.14)
from gi.repository import Vte
import subprocess
import urllib.request, urllib.parse, urllib.error
try:
from urllib.parse import unquote as urlunquote
except ImportError:
from urllib import unquote as urlunquote

from .util import dbg, err, spawn_new_terminator, make_uuid, manual_lookup, display_manager
from . import util
Expand Down Expand Up @@ -1120,7 +1123,7 @@ def on_drag_data_received(self, widget, drag_context, x, y, selection_data,
str=''
for fname in txt_lines[:-1]:
dbg('drag data fname: %s' % fname)
fname = "'%s'" % urllib.parse.unquote(fname[7:].replace("'",
fname = "'%s'" % urlunquote(fname[7:].replace("'",
'\'\\\'\''))
str += fname + ' '
txt=str
Expand Down
3 changes: 3 additions & 0 deletions terminatorlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""Terminator.util - misc utility functions"""

from __future__ import print_function

import sys
import cairo
import os
Expand All @@ -24,6 +26,7 @@
import subprocess
import gi


try:
gi.require_version('Gtk','3.0')
from gi.repository import Gtk, Gdk
Expand Down

0 comments on commit 7be1754

Please sign in to comment.