Skip to content

Commit 0c2261c

Browse files
committed
fix: keep python2 working a little longer.
1 parent c664ca5 commit 0c2261c

File tree

8 files changed

+15
-1
lines changed

8 files changed

+15
-1
lines changed

roundup/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import roundup.instance
3535
from roundup import __version__ as roundup_version
3636
from roundup import date, hyperdb, init, password, token_r
37+
from roundup.anypy import scandir_
3738
from roundup.anypy.my_input import my_input
3839
from roundup.anypy.strings import repr_export
3940
from roundup.configuration import (

roundup/anypy/scandir_.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
try:
2+
# python 3.5+
3+
from os import scandir
4+
except ImportError:
5+
# python 2 fallback
6+
import os
7+
import scandir # pip package
8+
os.scandir = scandir.scandir

roundup/backends/blobfiles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import os
2424

25+
from roundup.anypy import scandir_
2526

2627
def files_in_dir(dir):
2728
if not os.path.exists(dir):

roundup/cgi/templating.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import textwrap
2828

2929
from roundup import date, hyperdb, support
30+
from roundup.anypy import scandir_
3031
from roundup.anypy import urllib_
3132
from roundup.anypy.cgi_ import cgi
3233
from roundup.anypy.html import html_escape

roundup/init.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727

2828
from roundup import install_util
29+
from roundup.anypy import scandir_
2930
from roundup.configuration import CoreConfig
3031
from roundup.i18n import _
3132

roundup/instance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
from roundup import configuration, mailgw
4545
from roundup import hyperdb, backends, actions
46+
from roundup.anypy import scandir_
4647
from roundup.cgi import client, templating
4748
from roundup.cgi import actions as cgi_actions
4849
from roundup.exceptions import RoundupException

roundup/pygettext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /usr/bin/env python
2+
# -*- coding: utf-8 -*-
23
# Originally written by Barry Warsaw <[email protected]>
34
#
45
# Minimally patched to make it even more xgettext compatible

roundup/scripts/roundup_gettext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
sys.path.insert(0, rootdir)
2222
# --/
2323

24-
24+
from roundup.anypy import scandir_
2525
from roundup import configuration
2626
from roundup.cgi.TAL import talgettext
2727
from roundup.i18n import _

0 commit comments

Comments
 (0)