Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
ca4321bb
Commit
ca4321bb
authored
Dec 14, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the modern name for the configparser module
parent
477fef2d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+4
-4
setuptools/command/setopt.py
setuptools/command/setopt.py
+2
-2
setuptools/compat.py
setuptools/compat.py
+2
-2
setuptools/package_index.py
setuptools/package_index.py
+3
-3
No files found.
setuptools/command/easy_install.py
View file @
ca4321bb
...
...
@@ -1402,7 +1402,7 @@ def expand_paths(inputs):
def
extract_wininst_cfg
(
dist_filename
):
"""Extract configuration data from a bdist_wininst .exe
Returns a
ConfigP
arser.RawConfigParser, or None
Returns a
configp
arser.RawConfigParser, or None
"""
f
=
open
(
dist_filename
,
'rb'
)
try
:
...
...
@@ -1415,7 +1415,7 @@ def extract_wininst_cfg(dist_filename):
return
None
f
.
seek
(
prepended
-
12
)
from
setuptools.compat
import
StringIO
,
ConfigP
arser
from
setuptools.compat
import
StringIO
,
configp
arser
import
struct
tag
,
cfglen
,
bmlen
=
struct
.
unpack
(
"<iii"
,
f
.
read
(
12
))
...
...
@@ -1423,7 +1423,7 @@ def extract_wininst_cfg(dist_filename):
return
None
# not a valid tag
f
.
seek
(
prepended
-
(
12
+
cfglen
))
cfg
=
ConfigP
arser
.
RawConfigParser
(
cfg
=
configp
arser
.
RawConfigParser
(
{
'version'
:
''
,
'target_version'
:
''
})
try
:
part
=
f
.
read
(
cfglen
)
...
...
@@ -1433,7 +1433,7 @@ def extract_wininst_cfg(dist_filename):
# be text, so decode it.
config
=
config
.
decode
(
sys
.
getfilesystemencoding
())
cfg
.
readfp
(
StringIO
(
config
))
except
ConfigP
arser
.
Error
:
except
configp
arser
.
Error
:
return
None
if
not
cfg
.
has_section
(
'metadata'
)
or
not
cfg
.
has_section
(
'Setup'
):
return
None
...
...
setuptools/command/setopt.py
View file @
ca4321bb
...
...
@@ -37,10 +37,10 @@ def edit_config(filename, settings, dry_run=False):
while a dictionary lists settings to be changed or deleted in that section.
A setting of ``None`` means to delete that setting.
"""
from
setuptools.compat
import
ConfigP
arser
from
setuptools.compat
import
configp
arser
log
.
debug
(
"Reading configuration from %s"
,
filename
)
opts
=
ConfigP
arser
.
RawConfigParser
()
opts
=
configp
arser
.
RawConfigParser
()
opts
.
read
([
filename
])
for
section
,
options
in
settings
.
items
():
if
options
is
None
:
...
...
setuptools/compat.py
View file @
ca4321bb
...
...
@@ -7,7 +7,7 @@ PY2 = not PY3
if
PY2
:
basestring
=
basestring
import
__builtin__
as
builtins
import
ConfigParser
import
ConfigParser
as
configparser
from
StringIO
import
StringIO
BytesIO
=
StringIO
func_code
=
lambda
o
:
o
.
func_code
...
...
@@ -38,7 +38,7 @@ if PY2:
if
PY3
:
basestring
=
str
import
builtins
import
configparser
as
ConfigParser
import
configparser
from
io
import
StringIO
,
BytesIO
func_code
=
lambda
o
:
o
.
__code__
func_globals
=
lambda
o
:
o
.
__globals__
...
...
setuptools/package_index.py
View file @
ca4321bb
...
...
@@ -20,7 +20,7 @@ from distutils.errors import DistutilsError
from
setuptools.compat
import
(
urllib2
,
httplib
,
StringIO
,
HTTPError
,
urlparse
,
urlunparse
,
unquote
,
splituser
,
url2pathname
,
name2codepoint
,
unichr
,
urljoin
,
urlsplit
,
urlunsplit
,
ConfigP
arser
,
filter
,
map
,
urlunsplit
,
configp
arser
,
filter
,
map
,
)
from
setuptools.compat
import
filterfalse
from
fnmatch
import
translate
...
...
@@ -945,14 +945,14 @@ class Credential(object):
def __str__(self):
return '%(username)s:%(password)s' % vars(self)
class PyPIConfig(
ConfigP
arser.ConfigParser):
class PyPIConfig(
configp
arser.ConfigParser):
def __init__(self):
"""
Load
from
~/
.
pypirc
"""
defaults = dict.fromkeys(['username', 'password', 'repository'], '')
ConfigP
arser.ConfigParser.__init__(self, defaults)
configp
arser.ConfigParser.__init__(self, defaults)
rc = os.path.join(os.path.expanduser('~'), '.pypirc')
if os.path.exists(rc):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment