X Tutup
Skip to content

Commit 02c2412

Browse files
distribute sample-config and make locatable
fixes bpython#456
1 parent 20d1450 commit 02c2412

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

MANIFEST.in

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ include .pycheckrc
22
include AUTHORS
33
include CHANGELOG
44
include LICENSE
5-
include data/bpython
5+
include data/bpython.png
66
include data/bpython.desktop
77
include data/bpython.appdata.xml
88
include doc/sphinx/source/conf.py
99
include doc/sphinx/source/*.rst
1010
include doc/sphinx/source/logo.png
11-
include sample-config
1211
include *.theme
13-
include bpython/logo.png
14-
include ROADMAP
15-
include TODO
1612
include bpython/test/*.py
1713
include bpython/test/*.theme
1814
include bpython/translations/*/LC_MESSAGES/bpython.po
1915
include bpython/translations/*/LC_MESSAGES/bpython.mo
16+
include bpython/sample-config

bpython/repl.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
from __future__ import with_statement
2525
import code
26-
import codecs
2726
import errno
2827
import inspect
2928
import os
29+
import pkgutil
3030
import pydoc
3131
import requests
3232
import shlex
@@ -952,10 +952,8 @@ def edit_config(self):
952952
if not (os.path.isfile(self.config.config_path)):
953953
if self.interact.confirm(_("Config file does not exist - create new from default? (y/N)")):
954954
try:
955+
default_config = pkgutil.get_data('bpython', 'sample-config')
955956
bpython_dir, script_name = os.path.split(__file__)
956-
with open(os.path.join(bpython_dir, "sample-config")) as f:
957-
default_config = f.read()
958-
959957
containing_dir = os.path.dirname(os.path.abspath(self.config.config_path))
960958
if not os.path.exists(containing_dir):
961959
os.makedirs(containing_dir)

0 commit comments

Comments
 (0)
X Tutup