Skip to content

Commit

Permalink
attempt to make it work for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
darthbear committed Sep 25, 2020
1 parent 3f635be commit 1118b82
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pyhocon/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@
import socket
import sys
from datetime import timedelta
from glob import glob

import pyparsing

class ParseResults(pyparsing.ParseResults):
def __getattr__(self, item):
if item == '__deepcopy__':
raise AttributeError(item)
try:
return self[item]
except KeyError:
return ""


pyparsing.ParseResults = ParseResults

from pyparsing import (Forward, Group, Keyword, Literal, Optional,
ParserElement, ParseSyntaxException, QuotedString,
Regex, SkipTo, StringEnd, Suppress, TokenConverter,
Word, ZeroOrMore, alphanums, alphas8bit, col, lineno,
replaceWith)


import asset
from pyhocon.config_tree import (ConfigInclude, ConfigList, ConfigQuotedString,
ConfigSubstitution, ConfigTree,
Expand Down Expand Up @@ -46,6 +60,8 @@ def glob(pathname, recursive=False):
warnings.warn('This version of python (%s) does not support recursive import' % sys.version)
from glob import glob as _glob
return _glob(pathname)
else:
from glob import glob

logger = logging.getLogger(__name__)

Expand Down
13 changes: 13 additions & 0 deletions pyhocon/config_tree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
from collections import OrderedDict

import pyparsing
class ParseResults(pyparsing.ParseResults):
class ParseResults(pyparsing.ParseResults):

This comment has been minimized.

Copy link
@scottj97

scottj97 Sep 30, 2020

Contributor

This doesn't look right? class ParseResults.ParseResults?

I removed all 13 lines of this commit's changes to config_tree.py and it seems to have no effect.

def __getattr__(self, item):
if item == '__deepcopy__':
raise AttributeError(item)
try:
return self[item]
except KeyError:
return ""


from pyparsing import lineno
from pyparsing import col
try:
Expand Down
1 change: 1 addition & 0 deletions pyhocon/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
basestring
except NameError:
basestring = str
unicode = str


class HOCONConverter(object):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def run_tests(self):
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
],
packages=[
'pyhocon',
Expand Down

0 comments on commit 1118b82

Please sign in to comment.