Skip to content

Commit

Permalink
fix: keep python2 working a little longer.
Browse files Browse the repository at this point in the history
  • Loading branch information
rouilj committed Jul 16, 2024
1 parent c664ca5 commit 0c2261c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions roundup/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import roundup.instance
from roundup import __version__ as roundup_version
from roundup import date, hyperdb, init, password, token_r
from roundup.anypy import scandir_
from roundup.anypy.my_input import my_input
from roundup.anypy.strings import repr_export
from roundup.configuration import (
Expand Down
8 changes: 8 additions & 0 deletions roundup/anypy/scandir_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
try:
# python 3.5+
from os import scandir
except ImportError:
# python 2 fallback
import os
import scandir # pip package
os.scandir = scandir.scandir
1 change: 1 addition & 0 deletions roundup/backends/blobfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import os

from roundup.anypy import scandir_

def files_in_dir(dir):
if not os.path.exists(dir):
Expand Down
1 change: 1 addition & 0 deletions roundup/cgi/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import textwrap

from roundup import date, hyperdb, support
from roundup.anypy import scandir_
from roundup.anypy import urllib_
from roundup.anypy.cgi_ import cgi
from roundup.anypy.html import html_escape
Expand Down
1 change: 1 addition & 0 deletions roundup/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@


from roundup import install_util
from roundup.anypy import scandir_
from roundup.configuration import CoreConfig
from roundup.i18n import _

Expand Down
1 change: 1 addition & 0 deletions roundup/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

from roundup import configuration, mailgw
from roundup import hyperdb, backends, actions
from roundup.anypy import scandir_
from roundup.cgi import client, templating
from roundup.cgi import actions as cgi_actions
from roundup.exceptions import RoundupException
Expand Down
1 change: 1 addition & 0 deletions roundup/pygettext.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Originally written by Barry Warsaw <[email protected]>
#
# Minimally patched to make it even more xgettext compatible
Expand Down
2 changes: 1 addition & 1 deletion roundup/scripts/roundup_gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sys.path.insert(0, rootdir)
# --/


from roundup.anypy import scandir_
from roundup import configuration
from roundup.cgi.TAL import talgettext
from roundup.i18n import _
Expand Down

0 comments on commit 0c2261c

Please sign in to comment.