mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-15 05:00:45 +01:00
Unix: Disable 'crypt' command on Python >= 3.13
The module is not available anymore
This commit is contained in:
parent
e18332efde
commit
9ae7690484
@ -40,7 +40,6 @@ class InternetTestCase(PluginTestCase):
|
|||||||
'Host not found.')
|
'Host not found.')
|
||||||
|
|
||||||
def testWhois(self):
|
def testWhois(self):
|
||||||
self.assertNotError('internet whois ohio-state.edu')
|
|
||||||
self.assertNotError('internet whois microsoft.com')
|
self.assertNotError('internet whois microsoft.com')
|
||||||
self.assertNotError('internet whois inria.fr')
|
self.assertNotError('internet whois inria.fr')
|
||||||
self.assertNotError('internet whois slime.com.au')
|
self.assertNotError('internet whois slime.com.au')
|
||||||
|
@ -33,7 +33,6 @@ import os
|
|||||||
import re
|
import re
|
||||||
import pwd
|
import pwd
|
||||||
import sys
|
import sys
|
||||||
import crypt
|
|
||||||
import errno
|
import errno
|
||||||
import random
|
import random
|
||||||
import select
|
import select
|
||||||
@ -41,6 +40,12 @@ import struct
|
|||||||
import subprocess
|
import subprocess
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
|
try:
|
||||||
|
import crypt
|
||||||
|
except ImportError:
|
||||||
|
# Python >= 3.13
|
||||||
|
crypt = None
|
||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
from supybot.commands import *
|
from supybot.commands import *
|
||||||
@ -119,6 +124,7 @@ class Unix(callbacks.Plugin):
|
|||||||
irc.reply(format('%i', os.getpid()), private=True)
|
irc.reply(format('%i', os.getpid()), private=True)
|
||||||
pid = wrap(pid, [('checkCapability', 'owner')])
|
pid = wrap(pid, [('checkCapability', 'owner')])
|
||||||
|
|
||||||
|
if crypt is not None: # Python < 3.13
|
||||||
_cryptre = re.compile(b'[./0-9A-Za-z]')
|
_cryptre = re.compile(b'[./0-9A-Za-z]')
|
||||||
@internationalizeDocstring
|
@internationalizeDocstring
|
||||||
def crypt(self, irc, msg, args, password, salt):
|
def crypt(self, irc, msg, args, password, salt):
|
||||||
|
@ -31,6 +31,11 @@
|
|||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
try:
|
||||||
|
import crypt
|
||||||
|
except ImportError:
|
||||||
|
crypt = None
|
||||||
|
|
||||||
from supybot.test import *
|
from supybot.test import *
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -106,6 +111,7 @@ if os.name == 'posix':
|
|||||||
def testProgstats(self):
|
def testProgstats(self):
|
||||||
self.assertNotError('progstats')
|
self.assertNotError('progstats')
|
||||||
|
|
||||||
|
if crypt is not None: # Python < 3.13
|
||||||
def testCrypt(self):
|
def testCrypt(self):
|
||||||
self.assertNotError('crypt jemfinch')
|
self.assertNotError('crypt jemfinch')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user